Page 1 of 1

Changing Z order of window

Posted: Tue Mar 15, 2005 3:09 pm
by chippy73
I am trying to hide a dos window behind my PB window but it refuses to budge!

This what I am doing.....

Code: Select all

Case #Gadget_Form1_ButtonTX
            RunProgram("C:\dosprog.exe,"")
            hDosWin = FindWindow_(#Null,"c:dosprog")
            SendMessage_(hDosWin, #WM_CLOSE, 0, 0)
            hDosWin = FindWindow_(#Null,"c:dosprog")
            SendMessage_(hDosWin, SetWindowPos_(hDosWin,#HWND_BOTTOM,10,10,50,50,0),0,0)
The reason I am closing a window is that it generates 2 dos windows. Tried putting delays but didn't do anything. Maybe the repeat...until loop is going too fast?

Any ideas as to moving the Z order behind my PB window would be most welcomed.

Alan

Posted: Wed Mar 16, 2005 1:03 am
by Kale
Maybe this will help:
viewtopic.php?t=14302

Re: Changing Z order of window

Posted: Wed Mar 16, 2005 9:25 pm
by Henrik
chippy73 wrote:
The reason I am closing a window is that it generates 2 dos windows. Tried putting delays but didn't do anything. Maybe the repeat...until loop is going too fast?
Alan
Well thats a mess, make sure that it dosn't happen in the first place
Maybe do the Runprogram and stuff from a procedure
Or eventually flush a event if nothing else workes

To the Z order thing, bringing your pb-app HWND_TOPMOST might be an alternative.

Henrik

Posted: Sat Mar 19, 2005 7:56 am
by chippy73
Henrik,

Thanks for your comments, all noted.

Alan

Posted: Sat Mar 19, 2005 8:01 am
by chippy73
I stopped the dos screen popping up twice with the runprogram command by detecting if the left button had been clicked. like this.....

Code: Select all

Case #Gadget_Form1_ButtonTX
            If EventType() = #PB_EventType_LeftClick
            RunProgram(..................)
Should have done that in the first place anyway.

Alan