|
-
Sep 16th, 2010, 09:01 PM
#1
Thread Starter
Junior Member
TopMost In Visual Basic.
using either (vb2008 or vb2010)
hello, I am here to ask how to make my Form show up above all other Programs.
even full screen games.
Ive searched all over the place and I did get a Code.
which was this.
Code:
Public Declare Function 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) As Long
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Code:
Call SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
(Link to The thread of where i found this code)
http://www.vbforums.com/showthread.php?t=352702
but I get an error which is
In the call event "Form1.hwnd"
"hwnd" is not a member of 'topmostwindow.form1'
(All other tutorials and guides were either Outdated. or did not work.)
can someone point me in the right direction. is it even possible?
I am trying to draw my form over Eve-Online which is a MMORPG.
so i can run my own calculator/websearcher/notepad.
the ingames Calculator/websearcher/and notepad is
very slow and thats why i want to create my own, so thank you for listening.
-
Sep 17th, 2010, 02:25 AM
#2
Re: TopMost In Visual Basic.
Hello Clod14,
Are you sure you have posted in the correct forum?
This is the ASP.Net Forum, and to me, it looks like you are creating a Windows Form application. Is that correct?
Gary
-
Sep 17th, 2010, 06:28 AM
#3
Re: TopMost In Visual Basic.
Here ya go 
That's it. Nothing fancy.
-
Sep 17th, 2010, 08:27 AM
#4
Fanatic Member
Re: TopMost In Visual Basic.
 Originally Posted by Radjesh Klauke
Here ya go
That's it. Nothing fancy.
While that works a treat on windowed programs, any full screen will simply render right over the top and you won't see so much as a flicker. There's no "simple" way to place your form over a DirectX game unless you hook the directX itself and draw to the program. How to do that, I have no idea. Perhaps someone else will post a better solution than that and actually help you draw it with DX.
-
Sep 17th, 2010, 10:00 AM
#5
Re: TopMost In Visual Basic.
Another point: Only the last window who asked to be topmost gets to be topmost. So even ignoring DirectX, you can't ever guarantee your window will always be on top. You may attempt to be clever and keep stealing the topmost status, but Raymond Chen explained why that's an evil act.
It sounds like you're trying to make a game overlay so that point wouldn't really matter too much. DirectX and other GPU-accelerated graphics render on a "layer" above GDI. There's no way to use GDI to render in front of DirectX. I know it's possible to hook into games and create an overlay (Steam does this and I've used some other utilities with overlay) but I've never seen a tutorial or article about how to do it. My guess is it involves black magicks. Sorry I can't be of more help.
-
Sep 17th, 2010, 04:09 PM
#6
Thread Starter
Junior Member
-
Sep 17th, 2010, 05:04 PM
#7
Fanatic Member
Re: TopMost In Visual Basic.
I got interested in the subject as I have created a program that also is "semi fixed".
You might want to take a look at this library: http://directdrawoverlaylib.codeplex.com/
-
Sep 20th, 2010, 01:56 AM
#8
Re: TopMost In Visual Basic.
 Originally Posted by Clod14
@ gep13
to tell you the truth Im not sure if I did post in the correct forums
I thought I posted in the right area, as I am using Visual basic 2008
See, this is where I am a little confused. It looks to me like you did post in the right forum, as there is no mention of a moderator moving it. However, I really only look at the ASP.Net forum, and I am 100% convinced that I got to this thread from a thread in the ASP.Net forum, so I am really not sure that I understand what happened.
No harm done though.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|