C#Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Hello,
I want to make my winform flash in taskbar or statusbar
if i have to use a win32APi ?
if so ,would flashwindowEx works?
how to use it?
Is there any Example?
Declare the struct like this in your project namespace
namespace XYZ
{
.
.
public struct FLASHINFO
{
public Int32 cbSize;
public IntPtr hwnd;
public int dwFlags;
public UInt32 uCount;
public int dwTimeout;
}
And declare this function in your class
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(
ref FLASHINFO fInfo);
and then wherever you wanna call FlashWindowsEx use the code similar to this one
unsafe
{
if (result)
{
MessageBox.Show("Called successfully");
}
}
Open winuser.h and see the values for different flags
To be able to build this project you will have to go to
Project->YourProject Properties... , Configuration Properties->Build
and turn the option "Allow Unsafe Blocks" in the list on the right side to True
I know... I'm myself not too pleased with the unsafe block that I had to insert in the code, I'm trying to find a way around, but you have got the lead too, so if your strike first, do let me know.
Regards
Ankur Verma
.Net and C++ Specialist
Wiley Tech Support