FlashWindow() in c++.NET

G

gif

i need to use the function FlashWindow(), but it doesn't work under .NET.
how can i do?
I've thought to make unfocused the window for a bit and then set focus
again...but how?
 
D

Derrick Repep

gif,

I answered this in the other post you put in this forum. Give what I
recommended a shot, and let me know if it works for you.

Derrick
 
M

Mattias Sjögren

no that function is not reconized in my compiler couse it belong to MFC as
long as i use .NET

It may be part of MFC too, but there's a standard Win32 SDK function
called FlashWindow as well, and it should be available as long as you
include windows.h and link with user32.lib. Did you try

::FlashWindow( somHwnd, TRUE );

If it still doesn't work, please post your code and the compile error
you're getting.



Mattias
 
G

gif

Sorry i had forgot that posting ^__^
However i can't understand these steps couse i use VC++.
how can translate in c++?

1. Make sure that the following Imports statement is at the top of the
class file where you want to use an API:
Imports System.Runtime.InteropServices

2. Declare the DLL import:
<DllImport("user32.dll")> _
Private Shared Function FlashWindow(ByVal hwnd as IntPtr, ByVal
invert as Boolean) As Integer
End Function

Are there some other ways using the IDE of VStudio to make that?
 
G

gif

my function is in the .h of the class and in its .cpp is just included
"windows.h"
On right click on the name of solution into Explorer solution, end jumping
in to proprety
at the voice Linker i can see in Input subvoice loaded user32.lib together
to:
kernel32.lib
user32.lib <-------
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib

Anyway the error are:

c:\...\myfile.h(540): error C3861: 'FlashWindow': identifier not found, even
with argument-dependent lookup

c:\Programmi\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\WinUser.h(3778): error C2365: 'FlashWindow' :
redefinition; previous definition was a 'formerly unknown identifier'
 
M

Mattias Sjögren

OK, I wasn't able to reproduce that here, and I'm not sure what's
causing it. You may want to ask in the group
microsoft.public.dotnet.languages.vc



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top