Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thread.Abort and IL Pin
devvvy22-Nov-08 17:03
devvvy22-Nov-08 17:03 
QuestionUSB + C# Pin
E_Gold22-Nov-08 8:34
E_Gold22-Nov-08 8:34 
AnswerRe: USB + C# Pin
Christian Graus22-Nov-08 8:52
protectorChristian Graus22-Nov-08 8:52 
GeneralRe: USB + C# Pin
E_Gold22-Nov-08 9:15
E_Gold22-Nov-08 9:15 
GeneralRe: USB + C# Pin
Christian Graus22-Nov-08 9:56
protectorChristian Graus22-Nov-08 9:56 
GeneralRe: USB + C# PinPopular
Luc Pattyn22-Nov-08 9:27
sitebuilderLuc Pattyn22-Nov-08 9:27 
GeneralRe: USB + C# Pin
Wendelius22-Nov-08 10:56
mentorWendelius22-Nov-08 10:56 
QuestionWM_NCCALCSIZE resizing form continuously Pin
Chris Copeland22-Nov-08 8:09
mveChris Copeland22-Nov-08 8:09 
Hey.

I'm currently hijacking the WM_NCCALCSIZE function to define a custom caption and border areas.
But i'm having an issue with the form constantly resizing itself.

When I maximise the form, it fills the screen like I want it to, but when I restore it back, it's height and width properties are decreased.
I know where in the code it's happening, but I don't know how to stop it from constantly reducing in size, but rather maintain it's original size and simply "append" the non-client area. Any help would be appreciated Smile | :)

Here's the function for the WM_NCCALCSIZE calculations:

protected void WndNCCalcSize(ref Message m)
{
    NativeMethods.NCCALCSIZE_PARAMS para = new NativeMethods.NCCALCSIZE_PARAMS();
    NativeMethods.RECT winRect;

    if (m.WParam == IntPtr.Zero)
        winRect = (NativeMethods.RECT)Marshal.PtrToStructure(m.LParam, typeof(NativeMethods.RECT));
    else
    {
        para = (NativeMethods.NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(NativeMethods.NCCALCSIZE_PARAMS));
        winRect = para.rgrc0;
    }

    IntPtr HDC = NativeMethods.GetWindowDC(this.Handle);

    // Here's where I believe i'm having issues. It'll always continuosly reduce here because it's resizing the window
    // I know if I set the winRect.Top and winRect.Bottom to resize parallel to each other it'll work okay
    // But then it won't display the border. Any ideas? :\
    winRect.Top = winRect.Top + CaptionHeight;
    winRect.Bottom = winRect.Bottom - 3;
    winRect.Left = winRect.Left + 2;
    winRect.Right = winRect.Right - 2;

    this.BRect = winRect;

    if (m.WParam == IntPtr.Zero)
        Marshal.StructureToPtr(winRect, m.LParam, false);
    else
    {
        para.rgrc0 = winRect;
        Marshal.StructureToPtr(para, m.LParam, false);
    }

    NativeMethods.ReleaseDC(this.Handle, HDC);

    m.Result = new IntPtr(NativeMethods.WVR_REDRAW);

    base.WndProc(ref m);
}


Thanks.
Questionrichtextbox handle keyup and keydown events Pin
Stephen Po22-Nov-08 6:14
Stephen Po22-Nov-08 6:14 
AnswerRe: richtextbox handle keyup and keydown events Pin
derm222-Nov-08 7:28
derm222-Nov-08 7:28 
Questionc# Window form Data grid view columns show hide problem Pin
veereshIndia22-Nov-08 6:08
veereshIndia22-Nov-08 6:08 
QuestionListview: Make left and right arrow keys jump rows if needed Pin
derm222-Nov-08 4:58
derm222-Nov-08 4:58 
QuestionC# - Raw Socket, Packet filter Pin
Member 468084422-Nov-08 4:02
Member 468084422-Nov-08 4:02 
AnswerRe: C# - Raw Socket, Packet filter Pin
Dave Kreskowiak22-Nov-08 4:29
mveDave Kreskowiak22-Nov-08 4:29 
GeneralRe: C# - Raw Socket, Packet filter Pin
Member 468084422-Nov-08 10:01
Member 468084422-Nov-08 10:01 
GeneralRe: C# - Raw Socket, Packet filter Pin
Dave Kreskowiak22-Nov-08 12:25
mveDave Kreskowiak22-Nov-08 12:25 
GeneralRe: C# - Raw Socket, Packet filter Pin
Member 468084423-Nov-08 2:26
Member 468084423-Nov-08 2:26 
GeneralRe: C# - Raw Socket, Packet filter Pin
Dave Kreskowiak23-Nov-08 4:51
mveDave Kreskowiak23-Nov-08 4:51 
QuestionHow Enable/Disable Serial Port Pin
mutafa8122-Nov-08 3:46
mutafa8122-Nov-08 3:46 
QuestionC# Winforms GPS Mapping? Pin
wbjohnson22-Nov-08 3:30
wbjohnson22-Nov-08 3:30 
AnswerRe: C# Winforms GPS Mapping? Pin
Giorgi Dalakishvili22-Nov-08 4:42
mentorGiorgi Dalakishvili22-Nov-08 4:42 
GeneralRe: C# Winforms GPS Mapping? Pin
wbjohnson22-Nov-08 7:13
wbjohnson22-Nov-08 7:13 
GeneralRe: C# Winforms GPS Mapping? Pin
Giorgi Dalakishvili10-Dec-08 2:35
mentorGiorgi Dalakishvili10-Dec-08 2:35 
QuestionHow to do mouse gesture same program "Stroke It" Pin
ping_jacob22-Nov-08 2:44
ping_jacob22-Nov-08 2:44 
AnswerRe: How to do mouse gesture same program "Stroke It" Pin
Giorgi Dalakishvili22-Nov-08 3:20
mentorGiorgi Dalakishvili22-Nov-08 3:20 

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.