How to disable the second click

A

Alina

Hello

I have the following problem: an app Win CE with many screens, each screen
is a Control, only the Main screen is a Form.
When I double click a button on the Main screen, it takes it like a click on
the Main screen + a click on the button on the second screen and it opens
also a third screen (instead of remaining in the second one).
I try to disable the button on the Main screen during loading of the second
screen and enable it after. The system will beep at the second click, but it
will treat it !
I'm thinking to a TimeSpan solution - to take the difference of time between
the two clicks, to see if it's less then 1 sec ignore it... but the
DateTime.Now is not accurate.
How can I call something like GetLastInputInfo (is there something like
user32.dll for CF)... or another solution..?

Thank you,
Alina
 
A

Alina

Because separate forms will allow the user to switch from one screen to
another at any time.
 
C

Chris Tacke, eMVP

Maybe I'm missing something, but the user can only switch to another Form if
your app provides the mechanism to do so.
 
A

Alina

If you create each screen as a Form, all the screens will be on the Windows
taskbar, so the user can switch from a Form to another.
 
A

Alina

I try that I I've got the "NotSupportedException".. maybe does not work on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd, GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}
 
C

Chris Tacke, eMVP

It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As
Long
 
A

Alina

The form is still on the taskbar. Here is the full code (it works on Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex, UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...
 
C

Chris Tacke, eMVP

What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
The form is still on the taskbar. Here is the full code (it works on Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex, UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


Chris Tacke said:
It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
work
on screen
and loading difference
of it...
but
 
A

Alina

A System.IntPtr . Is there a problem ?


Chris Tacke said:
What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
The form is still on the taskbar. Here is the full code (it works on Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex, UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


Chris Tacke said:
It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As
Long)
takes
 
C

Chris Tacke, eMVP

I mean the value when you call it. The code looks right, but is style comes
back as zero, then the call is probably failing. If the value passed in as
hWnd is zero (NULL) then it will fail.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
A System.IntPtr . Is there a problem ?


Chris Tacke said:
What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
The form is still on the taskbar. Here is the full code (it works on Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex, UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As
Long)
As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



I try that I I've got the "NotSupportedException".. maybe does not work
on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd, GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}


Ah. Modify the Window style so they don't show up:
http://www.devx.com/vb2themax/Tip/18334

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



If you create each screen as a Form, all the screens will be
on
the
Windows
taskbar, so the user can switch from a Form to another.

Maybe I'm missing something, but the user can only switch to
another
Form
if
your app provides the mechanism to do so.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Because separate forms will allow the user to switch from one
screen
to
another at any time.

message
Why not just use separate Forms and avoid this altogether?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Hello

I have the following problem: an app Win CE with many
screens,
each
screen
is a Control, only the Main screen is a Form.
When I double click a button on the Main screen, it
takes
it
like
a
click
on
the Main screen + a click on the button on the second screen
and
it
opens
also a third screen (instead of remaining in the second
one).
I try to disable the button on the Main screen during
loading
of
the
second
screen and enable it after. The system will beep at the
second
click,
but
it
will treat it !
I'm thinking to a TimeSpan solution - to take the difference
of
time
between
the two clicks, to see if it's less then 1 sec ignore it...
but
the
DateTime.Now is not accurate.
How can I call something like GetLastInputInfo (is there
something
like
user32.dll for CF)... or another solution..?

Thank you,
Alina
 
A

Alina

Thank you for your quick answers. The hWnd after GetCapture is 3517984 :(


Chris Tacke said:
I mean the value when you call it. The code looks right, but is style comes
back as zero, then the call is probably failing. If the value passed in as
hWnd is zero (NULL) then it will fail.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
A System.IntPtr . Is there a problem ?


Chris Tacke said:
What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



The form is still on the taskbar. Here is the full code (it works on Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex,
UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



I try that I I've got the "NotSupportedException".. maybe does not
work
on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd, GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}


Ah. Modify the Window style so they don't show up:
http://www.devx.com/vb2themax/Tip/18334

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



If you create each screen as a Form, all the screens will be on
the
Windows
taskbar, so the user can switch from a Form to another.

message
Maybe I'm missing something, but the user can only switch to
another
Form
if
your app provides the mechanism to do so.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Because separate forms will allow the user to switch
from
one
 
C

Chris Tacke, eMVP

The next step is to redeclare the P/Invoke using the newer .NET syntax so
you can set SetLastError to True and then query the LastWin32Error to see
why it's failing.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
Thank you for your quick answers. The hWnd after GetCapture is 3517984 :(


Chris Tacke said:
I mean the value when you call it. The code looks right, but is style comes
back as zero, then the call is probably failing. If the value passed in as
hWnd is zero (NULL) then it will fail.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
A System.IntPtr . Is there a problem ?


What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



The form is still on the taskbar. Here is the full code (it works
on
Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex,
UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As
Long)
As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



I try that I I've got the "NotSupportedException".. maybe does not
work
on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd,
GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}


Ah. Modify the Window style so they don't show up:
http://www.devx.com/vb2themax/Tip/18334

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



If you create each screen as a Form, all the screens will
be
on
the
Windows
taskbar, so the user can switch from a Form to another.

message
Maybe I'm missing something, but the user can only
switch
 
A

Alina

I put [DllImport("coredll", SetLastError=true)] everywhere
Here is the updated code:

this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
int n0 = Marshal.GetLastWin32Error();
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
int n1 = Marshal.GetLastWin32Error();

n0=-2147483643 =>Invalid pointer ...
n1=87 =>The parameter is incorrect.
This means that the handle of the form is not correct (GetCapture fails)....

I try also:
IntPtr hWnd = FindWindow(null, "Form3");
=>error: 87 = The parameter is incorrect

Thank you,
Alina


Chris Tacke said:
The next step is to redeclare the P/Invoke using the newer .NET syntax so
you can set SetLastError to True and then query the LastWin32Error to see
why it's failing.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
Thank you for your quick answers. The hWnd after GetCapture is 3517984 :(


in
as
works
on
Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex,
UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As
Long)
As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



I try that I I've got the "NotSupportedException".. maybe
does
not
work
on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd,
GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}


message
Ah. Modify the Window style so they don't show up:
http://www.devx.com/vb2themax/Tip/18334

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



If you create each screen as a Form, all the screens
will
 
C

Chris Tacke, eMVP

Oh, I see it now. All of your API declarations are using Long. Change them
to Integer - Long in .NET is 64-bits.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Alina said:
I put [DllImport("coredll", SetLastError=true)] everywhere
Here is the updated code:

this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
int n0 = Marshal.GetLastWin32Error();
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
int n1 = Marshal.GetLastWin32Error();

n0=-2147483643 =>Invalid pointer ...
n1=87 =>The parameter is incorrect.
This means that the handle of the form is not correct (GetCapture fails)....

I try also:
IntPtr hWnd = FindWindow(null, "Form3");
=>error: 87 = The parameter is incorrect

Thank you,
Alina


Chris Tacke said:
The next step is to redeclare the P/Invoke using the newer .NET syntax so
you can set SetLastError to True and then query the LastWin32Error to see
why it's failing.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
passed
in
as
hWnd is zero (NULL) then it will fail.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



A System.IntPtr . Is there a problem ?


What is hWnd?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



The form is still on the taskbar. Here is the full code (it
works
on
Win
CE):

[DllImport("coredll")]
private static extern UInt32 GetWindowLong (IntPtr hWnd, int
nIndex);
[DllImport("coredll")]
private static extern UInt32 SetWindowLong (IntPtr hWnd, int nIndex,
UInt32
dwNewLong);
[DllImport("coredll")]
private static extern IntPtr SetCapture(IntPtr hWnd);
[DllImport("coredll")]
private static extern IntPtr GetCapture();
private const int GWL_EXSTYLE = -20;
private const UInt32 WS_EX_APPWINDOW = 0x00040000;

private void Form3_Load(object sender, System.EventArgs e)
{
try
{
this.Capture = true;
IntPtr hWnd = GetCapture();
this.Capture = false;
UInt32 style = GetWindowLong(hWnd, GWL_EXSTYLE);
SetWindowLong(hWnd, GWL_EXSTYLE, (style & ~WS_EX_APPWINDOW));
UInt32 styleEnd = GetWindowLong(hWnd, GWL_EXSTYLE);
int i=0;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}

Both style and styleEnd are 0...


It works, but must be "ported" to CE:

Private Declare Function GetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "coredll" _
(ByVal hWnd As Long, ByVal nIndex As Long, ByVal
dwNewLong
As
Long)
As
Long

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



I try that I I've got the "NotSupportedException".. maybe does
not
work
on
Compact Framework.
Here is the code:

private void Form3_Load(object sender, System.EventArgs e)

{

try

{

IntPtr hWnd = GetHWnd(this);

SetWindowLong(hWnd, GWL_EXSTYLE, (GetWindowLong(hWnd,
GWL_EXSTYLE)));

}

catch(Exception ex)

{

MessageBox.Show(ex.Message);

}

}


message
Ah. Modify the Window style so they don't show up:
http://www.devx.com/vb2themax/Tip/18334

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



If you create each screen as a Form, all the screens
will
be
on
the
Windows
taskbar, so the user can switch from a Form to another.

screen,
it beep
at
 

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