Process ProgramDisplay()
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Process ProgramDisplay()
I would like to be able to RunProgram(An.exe,#PB_Program_Hide), if necessary change it's screen location, then un-hide it.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Process ProgramDisplay()
Here's something (very simplified) I did for a similar situation... While it's not a "native" PB feature, it may get you by -- based on debugging I did, there is no way to "un hide" the program just based on the process handle...
Code: Select all
Procedure UnHideWindow(hwnd,*cTitle)
Protected cTitle.s{128}
Protected bContinue = #True
SendMessage_(hwnd,#WM_GETTEXT,128,@cTitle)
If Len(cTitle) And cTitle = PeekS(*cTitle)
ShowWindow(hWnd,#SW_SHOW)
bContinue = #False
EndIf
ProcedureReturn bContinue
EndProcedure
hProgram = RunProgram("notepad.exe","","c:\temp",#PB_Program_Open|#PB_Program_Hide)
Delay(100) ; Needed to allow notepad to open it's window
EnumWindows_(@UnHideWindow(),@"Untitled - Notepad")
While ProgramRunning(hProgram)
Delay(10)
Wend