hi guys ,
i am making a screen capture program and i want my main form to stay on top
so the user can take a screen shot of full screen games, i have found lots of stuff to keep it on top of all window but nothing works for full screen games
Below is 1 i have tried - Private Const HWND_TOPMOST = -1
-
Private Const HWND_NOTOPMOST = -2
-
Private Const SWP_NOACTIVATE = &H10
-
Private Const SWP_SHOWWINDOW = &H40
-
Private 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
-
-
-
Private Sub SetWindowOnTop(f As Form, bAlwaysOnTop As Boolean)
-
Dim iFlag As Long
-
-
iFlag = IIf(bAlwaysOnTop, HWND_TOPMOST, HWND_NOTOPMOST)
-
-
SetWindowPos f.hwnd, iFlag, f.Left / Screen.TwipsPerPixelX, f.Top / Screen.TwipsPerPixelY, _
-
f.Width / Screen.TwipsPerPixelX, f.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
-
End Sub
Any help will be appreciated.
<<<Gobble>>>
4 8056
hi guys ,
i am making a screen capture program and i want my main form to stay on top
so the user can take a screen shot of full screen games, i have found lots of stuff to keep it on top of all window but nothing works for full screen games
Below is 1 i have tried - Private Const HWND_TOPMOST = -1
-
Private Const HWND_NOTOPMOST = -2
-
Private Const SWP_NOACTIVATE = &H10
-
Private Const SWP_SHOWWINDOW = &H40
-
Private 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
-
-
-
Private Sub SetWindowOnTop(f As Form, bAlwaysOnTop As Boolean)
-
Dim iFlag As Long
-
-
iFlag = IIf(bAlwaysOnTop, HWND_TOPMOST, HWND_NOTOPMOST)
-
-
SetWindowPos f.hwnd, iFlag, f.Left / Screen.TwipsPerPixelX, f.Top / Screen.TwipsPerPixelY, _
-
f.Width / Screen.TwipsPerPixelX, f.Height / Screen.TwipsPerPixelY, SWP_NOACTIVATE Or SWP_SHOWWINDOW
-
End Sub
Any help will be appreciated.
<<<Gobble>>>
add a timer and call setwindowontop. make your interval like 500 (for half a second).
other apps are probably calling setwindowontop as well, making your form go below theirs.
however, if you notice it flickering, then that means the other apps are doing the same thing (calling setwindowontop in a timer event).
Try this, I'm not sure it is working, because this comes from a program that I made a long time ago. It is programmed in vb 6. Let me know if it works. - Private 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
-
Private Const SWP_NOMOVE = &H2
-
Private Const SWP_NOSIZE = &H1
-
Private Const HWND_TOPMOST = -1
-
Private Const HWND_NOTOPMOST = -2
-
-
Private Sub Form_Activate()
-
SetOnTop (True)
-
End Sub
-
-
-
' Make the form topmost or not.
-
Private Sub SetOnTop(Optional ByVal on_top As Boolean = True)
-
If on_top Then
-
SetWindowPos hwnd, _
-
HWND_TOPMOST, 0, 0, 0, 0, _
-
SWP_NOMOVE + SWP_NOSIZE
-
Else
-
SetWindowPos hwnd, _
-
HWND_NOTOPMOST, 0, 0, 0, 0, _
-
SWP_NOMOVE + SWP_NOSIZE
-
End If
-
End Sub
I'll be really curious to see whether you manage to do this. But to be honest, I don't think it's possible.
If by "full screen" you mean maximised, then obviously it's not a problem. But assuming you mean DirectX (or whatever the latest buzzword is) like games such as World of Warcraft use, I really doubt you'll be able to do so. They effectively take over the screen and push aside the usual windowing interface. So whatever you do with your window isn't likely to have much effect, unless you make it full-screen and push the game out of the way.
add a timer and call setwindowontop. make your interval like 500 (for half a second).
other apps are probably calling setwindowontop as well, making your form go below theirs.
however, if you notice it flickering, then that means the other apps are doing the same thing (calling setwindowontop in a timer event).
Good idea VBWheaties but yeah the games seem to be calling the same event because you can see the app flicker in the background.
I wonder if there is a way of forcing a a game into windowed mode
Thanks for the posts guys!!
<<<Gobble>>>
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Paul Munly |
last post by:
Hi,
I'm attempting to get a Swing application to go into Exclusive Fullscreen
mode and am curious if there's something that I need to do prior to
attempting to grab the fullscreen window. The code in question follows:
<code>
this.setUndecorated(true);
GraphicsDevice gd = this.getGraphicsConfiguration().getDevice();
if(gd.isFullScreenSupported()) {
|
by: SoloCDM |
last post by:
How do I keep my entire web page at a fixed width?
*********************************************************************
Signed,
SoloCDM
|
by: msa |
last post by:
Hi there,
First off, let me say that I know that launching to full screen is a
bad idea. I would never do it given the choice, but I must follow
orders from my boss, the boss that desparately wants a desktop
application made out of Internet technologies.
We're writing an application that has JavaScript enabled as a client
machine requirement. We need to support Windows with IE 5+ and
Netscape 7+ plus Mac with IE 5+ and Netscape 6.2+.
|
by: aagee |
last post by:
Hi all
Can someone clue me in on this? I just noticed that following doesn't
work as it used to:
window.open(... "fullscreen=yes" ...)
Used to get a window that occupied the whole screen; now I get the
title bar and status bar too. Any ideas?
|
by: BOOGIEMAN |
last post by:
Is it possible to make a full screen program (game) in C# ? I started
reading "mastering C#" book few days ago and I'm up to page 100 right now.
I looked at the forward chapters and it doesn't seem to write anything
about that.
Here is a little example of what I mean, done in PureBasic :
http://rapidshare.de/files-en/263361/Examples.rar.html
If it is possible, where can I download some simple
C# code examples on that ?
| |
by: Bill Struve |
last post by:
Need: Auto-logon to a terminal server, start a program, and, when the user
is quits the program, auto-logoff.
Problem: When msrdp.ocx is added to the Toolbox, attempting to draw the
control on the form gives the following "Microsoft Development Environment"
message:
"Compiler errors occured when generating a Windows Forms wrapper for ActiveX
control 'AxMSTSCLib'. Source code saved in '...AxInterop.MSTSCLib.cs'.
c:Documents and...
|
by: Jelle |
last post by:
Hi all,
I am looking for a way to get text on top of a fullscreen game and still
be able to play the game. I just want to use a little piece of the
screen and want the game screen still behind the text. I want to have
some info from another program on top. Probebly got more problems
coming, but just one at a time :)
Anyone have an idea how to do this? havent yet found something that can
help me.
|
by: n_g |
last post by:
how do i popup a message when user is running other fullscreen
application?
eg: i want to display phone number in corner of screen even user is
playing fullscreen directx/opengl game or watching DVDs in fullscreen
mode
i use directdraw overly but it seems cannot work when other fullscreen
directx app is running.
the overlay sample code :
http://www.gamedev.net/community/forums/topic.asp?topic_id=367591
|
by: =?Utf-8?B?RnJpam9sZXM=?= |
last post by:
Hello everyone,
I have a small application I wrote that sits in the systray and pops open a
small window if an event occurs. Works fine, except when I'm playing games.
:) If I have a fullscreen application going, the popup will steal focus
almost randomly causing the game to minimize. This is extremely annoying. Is
there a way to detect if anything is running in fullscreen mode? That way I
can prevent the popup from opening if there is....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |