|
Hey all, i have a question. I've searched everywhere for the answer and I can't find anything. So here it is. This is a part of the code, which I've copied from somewhere by the way.
<br />
public static bool IsUserPlayingFullscreen()<br />
{<br />
IntPtr hWnd = GetForegroundWindow();<br />
if (hWnd == GetDesktopWindow())<br />
{<br />
Logger.LogMessageToFile("F***");<br />
return false;<br />
}<br />
<br />
RECT rcWindow;<br />
GetWindowRect(hWnd, out rcWindow);<br />
IntPtr hm = MonitorFromRect(ref rcWindow, MONITOR_DEFAULTTONULL);<br />
if (hm == IntPtr.Zero) return false;<br />
MONITORINFO mi = new MONITORINFO();<br />
mi.cbSize = Marshal.SizeOf(typeof(MONITORINFO));<br />
GetMonitorInfo(hm, ref mi);<br />
return EqualRect(ref rcWindow, ref mi.rcMonitor);<br />
}<br />
Anyway, here I'm trying to detect if a full screen application is running. Runs pretty nice in most of the situations, besides one. If the desktop window is active, it is tricked in believing it is a FS App. I thought that this
"if (hWnd == GetDesktopWindow())" would detect if the current active window is the desktop, but it doesn't! Any help? Thanx in advance!
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:23am.
|
|
|
|
|
Thanx for the reply! Although I'm having quite some trouble converting it to C#.
This is where I've reached so far. For some reason it doesn't get by while (hWnd != IntPtr.Zero). As I've checked (hWnd == IntPtr.Zero) is always true.
<br />
public static bool IsFullScreenMode()<br />
{ <br />
int w = GetSystemMetrics(SM_CXSCREEN);<br />
int h = GetSystemMetrics(SM_CYSCREEN);<br />
<br />
IntPtr hWnd = new IntPtr();<br />
<br />
hWnd = FindWindowEx(GetDesktopWindow(), hWnd, null, null);<br />
while (hWnd != IntPtr.Zero)<br />
{<br />
if (GetWindowLong(hWnd, GWL_EXSTYLE) == WS_EX_TOPMOST)<br />
{<br />
RECT rcWindow;<br />
GetWindowRect(hWnd, out rcWindow);<br />
if ((w == (rcWindow.right - rcWindow.left)) && (h == (rcWindow.bottom - rcWindow.top)))<br />
{<br />
return true;<br />
}<br />
}<br />
hWnd = FindWindowEx(GetDesktopWindow(), hWnd, null, null);<br />
}<br />
return false;<br />
}<br />
Would be glad if you could help
|
|
|
|
|
Ok, I figured out that the desktop window is not what I see on the desktop(wallpaper).
So how do I get the wallpaper window handle?
|
|
|
|
|
IntPtr vHandle = FindWindowEx(GetDesktopWindow(), IntPtr.Zero, "Progman", null);
I found it! This is the one! This returns the handle to the Desktop ListView
|
|
|
|
|
I would want to realize a vumeter for measured the levels of the sound the one files audio....
I use Visual C# 2008.
Please, help me!!
What "class" must I use?
How must the code C# be?
I wait for your help.
Thanks
|
|
|
|
|
What have you tried ? What sort of audio format do you expect to examine ? What are you trying to achieve in general, what's the end goal ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
There is a lot of stuff on this subject available on the web, and it is not a simple problem. DirectSound seems to be the recommended way these days.
A quick Google search[^] lists hundreds of disscusions and articles on this subject
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
I am trying to graph xy position for a third variable value. Ex .. pressure distribution over an area. Does anyone know if ms chart can do this?
I have been going through the ms winsamples and documentation, did some googling but came up short.
any tips or hints for other graphing packages that could do such a thing would be helpful.
|
|
|
|
|
I was recently reading the docs, and I don't think it does that. I believe the Dundas chart does, and I'm not sure if that's free now, or not.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I called dundas, and they said they do not offer a z axis. But thanks for your time, I appreciate it.
|
|
|
|
|
Have a look at that[^]!
There is about 72 samples, that will help!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
thank you so much, I think WPF Dynamic Data will do it.
|
|
|
|
|
Our app pretty much takes over the machine it is running on (we customize machines and place our app on them).
What I need to know is if there is a way (and if so how) to launch Windows's internal dialogs for configuring the wireless adapters in a system running Windows 7. If you can tell me how to do it in Vista, that might be OK too, because they might end up being the same.
Thanks!
|
|
|
|
|
|
Yes, it does - and that is exactly what I was looking for.
Thanks...
|
|
|
|
|
Hi all,
I just need to know how do encrypt one column in my datagridview out of many.
I do not want to show that column value to user because it contain password.
thanks in advance
|
|
|
|
|
you don't want to show it encrypted, just don't show it at all, either by writing your own column definitions, or by not requesting it from the data source.
You don't encrypt passwords in your data source ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Christian, I understand what you are saying. I am not encrypting the database rather
when it display on the datagridview I don't want the admin to see other password but he/she
should be able to change it without knowing what it was.it can be as MasktextBox like " *******".
thanks
|
|
|
|
|
You should have a function that encrypt a user password. There are many password encryption algorithm. However you take that encrypted password string and stored in the database. This way anyone who would have access to the database or if somehow manged to the password all the would see is a long encrypted string.
If you want to update the password field then just update the password field with the new encrypted password and you are all set.
|
|
|
|
|
hi netJP12L, I see what you are saying. I am trying to do the same but having some deficulties.
thanks for your help.
|
|
|
|
|
You really do not want to change passwords in a DataGridView environment. Since you shouldn't be showing what the new password is, you need to have the user type the passwrod twice to confirm it was typed correctly. You don't have that option in a DGV unless you write a custom editor for that field (NOT easy!). A better method would be to open a seperate form for that record and asking for the new password twice.
|
|
|
|
|
Hi Dave, thaks for saving my time. I was trying for long time. Could not make it work.
I will try different way.
|
|
|
|
|
What you could do (don't ask me how, I just know that we are using it in our project) is, if you're using SQL 2005, encrypt the column which contains your passwords, generate the proper cert for that encryption to happen.
Then create an Updatable View which will only allow certain SQL users to see the actual values and when other users do a select on that view, it will appear as NULL to them. Also, if you have access, you can change the password values through the Updatable View (you'll have to since the column is not a string column anymore but a binary one).
You'll have to find out how to do it but it is definitely possible as we are using it.
- Last Attacker
|
|
|
|
|
Hi Atacker,
thanks for your suggestion. I did something it will not show to any user but user ( who has access to ) will be able to change modify it.
thanks
|
|
|
|