Cant resize the TaskBar

G

Guest

I'm trying to resize the TaskBar. I can successfully hide and show it but
can't get it to respond to the SetWindowPos call to User32.

I am using the following definition for SetWindowPos:

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(
IntPtr hWnd, // handle to window
int hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
uint uFlags // window-positioning options
);


And I am calling it as follows:
x = User32.SetWindowPos
(
hwnd
, 0
, -2
, -2
, 52
, 1026
, User32.SW_SHOWNORMAL
);

Am I doing something obviously wrong??
 
G

Guest

Yes. It is unlocked. I can resize it manually, and it can also be
successfully hidden and unhidden in code.

Gabriel Lozano-Morán said:
I am assuming that the taskbar is unlocked?

Gabriel Lozano-Morán

Wozza said:
I'm trying to resize the TaskBar. I can successfully hide and show it but
can't get it to respond to the SetWindowPos call to User32.

I am using the following definition for SetWindowPos:

[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern bool SetWindowPos(
IntPtr hWnd, // handle to window
int hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
uint uFlags // window-positioning options
);


And I am calling it as follows:
x = User32.SetWindowPos
(
hwnd
, 0
, -2
, -2
, 52
, 1026
, User32.SW_SHOWNORMAL
);

Am I doing something obviously wrong??
 
G

Gabriel Lozano-Morán

You could try to log the messages sent using Spy++ and see what happens
exactly when you manually move the window.

Gabriel
 

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