User forums > Help
Win API doesn't working
kkez:
--- Quote from: sethjackson on June 22, 2006, 06:25:49 pm ---
--- Quote from: kkez on June 22, 2006, 06:21:06 pm ---
--- Quote from: thomas on June 22, 2006, 05:36:53 pm ---(and who needs them anyway).
--- End quote ---
Well, the latter is useless, but you need the first one to create a window :) but you're right, you can get them easily.
--- End quote ---
Actually you don't.
--- End quote ---
You need the instance, in one way (using the WinMain argument) or another (using GetModuleHandle(NULL)). But you need it :)
The cmdShow can't be replaced the same way, since if you ShellExecute/CreateProcess one program and require it to start hidden or maximized or whatever, with that code you always show it...
sethjackson:
--- Quote from: kkez on June 22, 2006, 08:27:22 pm ---
--- Quote from: sethjackson on June 22, 2006, 06:25:49 pm ---
--- Quote from: kkez on June 22, 2006, 06:21:06 pm ---
--- Quote from: thomas on June 22, 2006, 05:36:53 pm ---(and who needs them anyway).
--- End quote ---
Well, the latter is useless, but you need the first one to create a window :) but you're right, you can get them easily.
--- End quote ---
Actually you don't.
--- End quote ---
You need the instance, in one way (using the WinMain argument) or another (using GetModuleHandle(NULL)). But you need it :)
The cmdShow can't be replaced the same way, since if you ShellExecute/CreateProcess one program and require it to start hidden or maximized or whatever, with that code you always show it...
--- End quote ---
Well can't you just do ShowWindow(wnd, SW_HIDE)..... :? I read your post wrong. Sorry. :oops: You need the instance, but how you go about getting it is another matter. :)
kkez:
--- Quote from: sethjackson on June 22, 2006, 08:32:04 pm ---Well can't you just do ShowWindow(wnd, SW_HIDE)..... :?
--- End quote ---
Well, how do you know if it should be hidden or maximized or normal without the cmdShow that is passed to WinMain from ShellExecute or CreateProcess?
sethjackson:
--- Quote from: kkez on June 22, 2006, 08:39:04 pm ---
--- Quote from: sethjackson on June 22, 2006, 08:32:04 pm ---Well can't you just do ShowWindow(wnd, SW_HIDE)..... :?
--- End quote ---
Well, how do you know if it should be hidden or maximized or normal without the cmdShow that is passed to WinMain from ShellExecute or CreateProcess?
--- End quote ---
Hmm good question..... Maybe GetStartupInfo()?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getstartupinfo.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/startupinfo_str.asp
kkez:
You're right :) i didn't know that function.
Navigation
[0] Message Index
[*] Previous page
Go to full version