Posted November 23, 200717 yr I have a nice tool that i use but it has the nasty property of always on top (topmost),I reasonably experienced with assembly but i always have a hard time with VB.Anybody know how i could remove the top most,No idea where to start or how to trace it.Thanks
November 23, 200717 yr try compiling one test form app. with top most turned on, and the same witout it, then check bytes around form caption in hexeditor for differences..
November 23, 200717 yr You would use the SetWindowPos api with HWND_NOTOPMOSTExample:Private Const HWND_NOTOPMOST = -2Private Const SWP_NOSIZE = &H1Private Const SWP_NOMOVE = &H2Private Const SWP_NOACTIVATE = &H10Private Const SWP_SHOWWINDOW = &H40Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)Private Sub Form_Activate() SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZEEnd Sub Edited November 23, 200717 yr by Pimp.exe
November 25, 200717 yr vb6 forms dont come standard with topmost, so your little tool you wrote must have code for being on top, remove that and you form wont be topmost....I first thought you wanted topmost but i read your post again, does'nt make sence because there is no topmost in vb6 unless you write code to do so
November 25, 200717 yr Author vb6 forms dont come standard with topmost, so your little tool you wrote must have code for being on top, remove that and you form wont be topmost....I first thought you wanted topmost but i read your post again, does'nt make sence because there is no topmost in vb6 unless you write code to do soYe but how do you find that code?I have no idea how to trace or find it stupid VB :S
November 25, 200717 yr Author So i placed a break point on the SetWindowsPos and createwindow API,And looked for a TOPMOST flag but i didnt see it :S
November 26, 200717 yr From what I read, he didnt code the tool. He has a tool that puts itself TOPMOST. Edited November 26, 200717 yr by Pimp.exe
November 26, 200717 yr settel down pork chops, I dont know where you get that from ( 4th time I have done something to you). I never corrected anyone, I was'nt sure if he wanted topmost in vb for a tool he was writting after seeing his second post I relized he want to remove topmost from an external vb6 app, The reason I thought it was for his own app is the code you supplied.Private Const HWND_NOTOPMOST = -2Private Const SWP_NOSIZE = &H1Private Const SWP_NOMOVE = &H2Private Const SWP_NOACTIVATE = &H10Private Const SWP_SHOWWINDOW = &H40Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)Private Sub Form_Activate() SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZEEnd SubThe misconfusion was when you wrote "Me.hWnd" meaning the app he has written in vb, because from what I understand he would need to find the handel of the external app then call setwindowpos api. Sorry if I missunderstood but the code given was clearly for the app written to be topmost not an external app.P.s sorry if that upset you that was'nt my intention.......... Peace pimp Edited November 26, 200717 yr by Departure
November 26, 200717 yr Well my code was an example of how to use the API and the concept. I see where u got that though. Perhaps I have read some of your posts wrong Departure. No problems then.
January 17, 200817 yr Search for text string "SetWindowPos" Find Where this address gets Pushed, should be around MSVBVM60.DllFunctionCall Goto the location where this gets called from and up above there should be Push -1 Change to Push -2
Create an account or sign in to comment