PDA

View Full Version : help!(can't explain in title!)


goldingname
10-10-2006, 03:14 PM
hello everybody!

i have a problem , i wish you can solve it!

first i want to run a program like "Notepad" and wait for its
close for rest of the actions:
==================================
result = File.Run("notepad.exe", "", "", SW_SHOWNORMAL, true);
==================================
but my problem is here

imagine sometimes(not always) notepad.exe will run and for unknown reasons
you are still in your autorun!
so you can press Alt+TAB(one time or ....) to change your window


i can use these actions for this problem
=========================================
windows = Window.EnumerateTitles();
window_name = "Notepad";
for handle, title in windows do
result = String.Find(title, window_name, 1, false);
if (result ~= -1) then
Window.SetOrder(handle, HWND_TOPMOST);
end
end
=========================================

but if you remebered first action it's impossible to execute an action
when your program is waiting for notepad's response!

it's something i have to add
i'm already using Page.Timer!
honestly first code is in PageTimer!

how can i solve this problem?

i just know one way!

1- execute two actions in same time

can anybody help me?

Buffman
10-10-2006, 03:29 PM
Does this help?
Window.SetOrder(Application.GetWndHandle(), HWND_BOTTOM);
result = File.Run("notepad.exe", "", "", SW_SHOWNORMAL, true);
Window.SetOrder(Application.GetWndHandle(), HWND_TOP);

goldingname
10-10-2006, 03:48 PM
thank u Buffman

but it's not working

Buffman
10-10-2006, 03:52 PM
Do you know whats causing notepad to open in the background?

Is your project set to "always on top" ?

goldingname
10-10-2006, 04:00 PM
hello again

i used notepad.exe for example
i'm sure problem is from notepad.exe(for example)
and it happens sometimes not always and i don't know why


No my project is not "Always on Top"
and it's Kiosk(for more information)

crj
10-11-2006, 10:58 AM
My first Choise is:
Application.Minimize();
result = File.Run("notepad.exe", "", "", SW_SHOWNORMAL, true);
Application.Restore();:D

goldingname
10-12-2006, 08:12 AM
thank u all

finally i made another program that check for Windows!