Click here to Skip to main content
15,913,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Embedded User Control in IE Problem Pin
Yolan14-Jun-04 4:09
Yolan14-Jun-04 4:09 
GeneralRe: Embedded User Control in IE Problem Pin
Heath Stewart14-Jun-04 4:24
protectorHeath Stewart14-Jun-04 4:24 
GeneralRe: Embedded User Control in IE Problem Pin
Yolan14-Jun-04 4:34
Yolan14-Jun-04 4:34 
GeneralRe: Embedded User Control in IE Problem Pin
Heath Stewart14-Jun-04 4:47
protectorHeath Stewart14-Jun-04 4:47 
GeneralMultiThreaded Socket Pimp! Pin
Anonymous14-Jun-04 3:31
Anonymous14-Jun-04 3:31 
QuestionHow to? Adding a line to a textbox without reloading whole text? Pin
matthias s.14-Jun-04 2:53
matthias s.14-Jun-04 2:53 
AnswerRe: How to? Adding a line to a textbox without reloading whole text? Pin
Dave Kreskowiak14-Jun-04 3:19
mveDave Kreskowiak14-Jun-04 3:19 
Generalblinking Pin
sreejith ss nair14-Jun-04 2:31
sreejith ss nair14-Jun-04 2:31 
GeneralRe: blinking Pin
Dave Kreskowiak14-Jun-04 3:23
mveDave Kreskowiak14-Jun-04 3:23 
GeneralListView colomn color Pin
ahlam-roshan14-Jun-04 0:30
ahlam-roshan14-Jun-04 0:30 
GeneralRe: ListView colomn color Pin
Corinna John14-Jun-04 1:28
Corinna John14-Jun-04 1:28 
GeneralRe: ListView colomn color Pin
ahlam-roshan14-Jun-04 2:41
ahlam-roshan14-Jun-04 2:41 
GeneralRe: ListView colomn color Pin
Heath Stewart14-Jun-04 4:22
protectorHeath Stewart14-Jun-04 4:22 
QuestionHow to protect a software from crack Pin
SoftComplete14-Jun-04 0:24
SoftComplete14-Jun-04 0:24 
AnswerRe: How to protect a software from crack Pin
Dave Kreskowiak14-Jun-04 3:28
mveDave Kreskowiak14-Jun-04 3:28 
AnswerRe: How to protect a software from crack Pin
Wackatronic14-Jun-04 6:53
Wackatronic14-Jun-04 6:53 
QuestionHide taskbar and change DPI settings?? Pin
r913-Jun-04 23:47
r913-Jun-04 23:47 
AnswerRe: Hide taskbar and change DPI settings?? Pin
Dave Kreskowiak14-Jun-04 3:47
mveDave Kreskowiak14-Jun-04 3:47 
GeneralRe: Hide taskbar and change DPI settings?? Pin
Heath Stewart14-Jun-04 4:16
protectorHeath Stewart14-Jun-04 4:16 
GeneralRe: Hide taskbar and change DPI settings?? Pin
r914-Jun-04 6:55
r914-Jun-04 6:55 
GeneralRe: Hide taskbar and change DPI settings?? Pin
Heath Stewart14-Jun-04 8:43
protectorHeath Stewart14-Jun-04 8:43 
You should first read about P/Invoke. See Consuming Unmanaged DLL Functions[^] in the .NET Framework SDK. Just jumping into something without understanding is never a good idea.

You can P/Invoke the SHAppBarMessage like so:
[DllImport("shell32.dll")]
[return: MarshalAs(UnmanagedType.SysUInt)]
private static extern IntPtrSHAppBarMessage(
  [MarshalAs(UnmanagedType.U4)] int dwMessage,
  APPBARDATA data);
 
[StructLayout(LayoutKind.Sequential)]
public struct APPBARDATA
{
  [MarshalAs(UnmanagedType.U4)] public int size;
  public IntPtr handle;
  [MarshalAs(UnmanagedType.SysUInt)] public IntPtr callbackMessage;
  [MarshalAs(UnmanagedType.SysUInt)] public IntPtr edge;
  public RECT rc;
  public IntPtr lParam;
}
 
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
  public int left;
  public int top;
  public int right;
  public int bottom;
}
In order to pass the right messages, read about the SHAppBarMessage[^] API.

There is also an example on CodeProject you can take a look at. Read C# does Shell, Part 3[^].

To get the HWND for the task bar, you'll need to also P/Invoke FindWindow and search for the window class "Shell_TrayWnd". That'll give you the IntPtr to assign to the APPBARDATA.handle field.

You can find more P/Invoke signatures for common Windows APIs at http://pinvoke.net[^].

 

Microsoft MVP, Visual C#
My Articles
GeneralDate time format Pin
Member 445055113-Jun-04 23:46
Member 445055113-Jun-04 23:46 
GeneralRe: Date time format Pin
Stefan Troschuetz14-Jun-04 1:12
Stefan Troschuetz14-Jun-04 1:12 
GeneralRe: Date time format Pin
Heath Stewart14-Jun-04 4:12
protectorHeath Stewart14-Jun-04 4:12 
GeneralRe: Date time format Pin
Jon Sagara14-Jun-04 8:02
Jon Sagara14-Jun-04 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.