| Main > Software Forum |
| MameWah Technical Thread (for MinWah) |
| << < (3/4) > >> |
| Minwah:
--- Quote from: headkaze on November 02, 2005, 12:05:45 pm ---Thats strange, they always appear first for me. But anyways, the messagebox isn't supposed to be there anyway, its just to explain whats happening. The messagebox's are always causing wierd and wonderful effects... thats why in a production release they would be removed. --- End quote --- Sorry, what I meant is say for example if you *added* a msgbox just after the Start__ part. StartProcess waits until the shelled app has been terminated, then would display the msgbox. With StartShortcut it launches the shortcut and the msgbox is displayed immediately after (ie before the launched app is terminated). I think what you said earlier means that to fix this one would add a further step to determine the app/process launched by the shortcut, and then wait for this process to finish. --- Quote ---If they can do it in DOS we can do it in windows :) Both can work on the same level, just that Windows now restricts access per user access level. So no problem, if they can do it so can we :) --- End quote --- True, but I admire your confidence! ;) |
| headkaze:
--- Quote ---Sorry, what I meant is say for example if you *added* a msgbox just after the Start__ part. StartProcess waits until the shelled app has been terminated, then would display the msgbox. With StartShortcut it launches the shortcut and the msgbox is displayed immediately after (ie before the launched app is terminated). I think what you said earlier means that to fix this one would add a further step to determine the app/process launched by the shortcut, and then wait for this process to finish. --- End quote --- Ahh I get what your saying. In example 2 I demonstrate launching a shortcut without a titlebar. It's impossible to get the process or window handle. The only way to do that is searching out the titlebar using FindWindow(). So in example 3 and 4 I demonstrate using LaunchShortcut() but give it the titlebar of notepad.exe and iexplore.exe so it does get a handle to the process and window, thats how it makes notepad's window in example 3 go fullscreen with no border and menu. In example 2, LaunchShortcut() can't wait for the process to end, so it exits back to the main window process WindowProc() and continues processing messages. |
| Minwah:
--- Quote from: headkaze on November 03, 2005, 02:43:06 am ---Ahh I get what your saying. In example 2 I demonstrate launching a shortcut without a titlebar. It's impossible to get the process or window handle. The only way to do that is searching out the titlebar using FindWindow(). So in example 3 and 4 I demonstrate using LaunchShortcut() but give it the titlebar of notepad.exe and iexplore.exe so it does get a handle to the process and window, thats how it makes notepad's window in example 3 go fullscreen with no border and menu. In example 2, LaunchShortcut() can't wait for the process to end, so it exits back to the main window process WindowProc() and continues processing messages. --- End quote --- Thanks, that makes perfect sense. So if you don't know the titlebar string is it impossible to find the window? Just that in your example you obviously know the titlebar for Notepad & Internet Explorer, but in my FE it could be any program so this will always be different. |
| swindus:
Its possible to iterate thru all windows and get the process id of them with api functions. Then match the process ids of all windows with the id you get when you start an application with CreateProcess. So you can find the window without knowing the titlebar caption. |
| headkaze:
--- Quote ---Thanks, that makes perfect sense. --- End quote --- |
| Navigation |
| Message Index |
| Next page |
| Previous page |