|
I think your application should inherit from System.Windows.Forms.Form .
Use the best guess
|
|
|
|
|
yes, that's what I was trying to get across in the other thread by providing an example.
Re-WndProc-does-not-work-in-Windows-CE-5-0.aspx
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
I often wonder why some questioners make life so difficult for themselves, and go round and round in circle rather than accepting advice or guidance.
Use the best guess
|
|
|
|
|
> "I often wonder why some questioners make life so difficult for themselves, and go round and round in circle rather than accepting advice or guidance." <
Yes, it's like they're blinded by their own self belief that they are right, can't see at all. Even when they patently don't have a deep understanding of coding and won't admit it.
There's not much point continuing to help them, so I send them elsewhere.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
I looked the following code in MSDN, but don't know how to test it. is onMouseDownClickcount() an event handler? then how can I link it to a control, ex: button?
The following example creates a MouseButtonEventHandler which determines if a single, double, or triple click occurred. ClickCount property is used to determine the number clicks.
private void OnMouseDownClickCount(object sender,
MouseButtonEventArgs e)
{
if (e.ClickCount == 1)
{
lblClickCount.Content = "Single Click";
}
if (e.ClickCount == 2)
{
lblClickCount.Content = "Double Click";
}
if (e.ClickCount > 3)
{
lblClickCount.Content = "Triple Click";
}
}
|
|
|
|
|
You found that here[^], didn't you? You ought to tell us the source.
It looks like an event handler for mouse events in a WPF application. Hence you cannot use it in a Windows Forms application.
|
|
|
|
|
yes, I found the code in MSDN website.
|
|
|
|
|
Hello,
I am doing program in VB for Windows CE 5.0. I need to catch messages from other programs in VB window. In VB is defined a function WndProc. But, this function does not work (or exist) on CE. Compiler cannot recognize it.
Protected Overrides Sub WndProc(ByRef recWinMessage As Microsoft.WindowsCE.Forms.Message)
MyBase.WndProc(recWinMessage)
End Sub
Can anyone help me?
|
|
|
|
|
You might be able to implement missing features using Library imports + P/Invoke
Look toward the end of this article. msdn.microsoft.com/en-us/library/aa446564.aspx
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
I tried to read an article, but I didn't find anything helpful. Problem is, that I am using VB for Windows CE and there is not supported WndProc. What can I do?
This is a fragment of code. What I am doing wrong? WndProc cannot be recognized od VB for Window CE.
<dllimport("coredll.dll", setlasterror:="True," charset:="CharSet.Auto)"> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
<dllimport("coredll.dll", setlasterror:="True," charset:="CharSet.Auto)"> Private Shared Function SendMessage( _
ByVal hwnd As IntPtr, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
End Function
<dllimport("coredll.dll", setlasterror:="True)"> _
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As WndProc) As Integer
End Function
Public Shared Sub Main2()
Dim ip As IntPtr
ip = FindWindow(vbNullString, "Kvant 1.0")
If (ip <> 0) Then
MsgBox("Kuk!")
SendMessage(ip, &H10, 0, 0)
End If
End Sub
Dim GWL_WNDPROC As Long = -4
Dim lpPrevWndProc As Integer
Public Function SubClass(ByVal lHwnd As Long) As Boolean
Beep()
lpPrevWndProc = SetWindowLong(lHwnd, GWL_WNDPROC, AddressOf WndProc)
End Function
Protected Overrides Sub WndProc(ByRef recWinMessage As Microsoft.WindowsCE.Forms.Message)
MyBase.WndProc(recWinMessage)
End Sub
Shared Sub Main()
Application.Run(New AOutForm())
End Sub
|
|
|
|
|
Did you add the reference to Microsoft.WindowsCE.Forms in your project?
It is supported.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Yes. When I inherit class like this
Partial Public Class AOutForm
Inherits Microsoft.WindowsCE.Forms.MessageWindow
then WndProc works, but I have problem to launch application, because
Application.Run(New AOutForm())
does not work. What to do?
|
|
|
|
|
The VB My feature is supported in the compact framework. Perhaps that will simplify your efforts
msdn.microsoft.com/en-US/library/5btzf5yk(v=vs.80).aspx
I can't find any useful info about Application.Run with the current MSDN site.
So I keep having to switch to another machine that has most of the old Windows CE stuff.
Can you let me know any error codes that you receive, I will be able to look those up, on the other machine too.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
How can I create a dialog Window in VB for CE. I mean something like DoModal() in C++. Sorry, I have just poor knowledge about this.
The error message what you are asking me for is:
Error 3 Value of type 'AOut.WNDMSG' cannot be converted to 'System.Windows.Forms.Form'. C:\Program Files\Measurement Computing\DAQFlex for Windows CE\Examples\VB\AOut\AOutForm.Common.vb 209 25 AOut
|
|
|
|
|
|
I know that example. I does not help me because my Window class is derived from Microsoft.WindowsCE.Forms.MessageWindow, not from System.Windows.Forms.Form.
|
|
|
|
|
You might get more help within Microsoft's own developer forums, as there's scant info about Windows CE programming on the wider web.
They have been happy to help me in the past.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
Do you have a web address?
|
|
|
|
|
|
I use the statements like the following:
If SaveFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
If SaveFileDialog1.FileName = "" Then
MsgBox("Plase input file name ")
Then if I don't input file name in the dialog,just press the save button, it seems the dialog can't return, i.e, close it.
Is the DialogResult.OK requires user must input filename?
|
|
|
|
|
The "ShowDialog" method is blocking; it will halt the execution of the current thread until the dialog is dismissed by the user. You're checking whether the result of that method equals the enumerated value "DialogResult.OK".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I mean if user input nothing in the dialog, then user press save, it will not return.
Is that showdialog() ask user must input something?
|
|
|
|
|
econy wrote: I mean if user input nothing in the dialog, then user press save, it will not return.
It'll return, but with a different value.
econy wrote: Is that showdialog() ask user must input something?
Yup, with various options[^] to influence it's behaviour.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: econy wrote: I mean if user input nothing in the dialog, then user press save, it will not return.
It'll return, but with a different value.
Nope, not so, please see Richards answer, which is correct to my knowledge
Why can't I be applicable like John? - Me, April 2011 ----- Beidh ceol, caint agus craic againn - Seán Bán Breathnach ----- Da mihi sis crustum Etruscum cum omnibus in eo! ----- Just because a thing is new don’t mean that it’s better - Will Rogers, September 4, 1932
|
|
|
|
|
I did, a few weeks ago. Didn't update this answer, as his problem is already solved.
Simply downvote the answer if you don't like it
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|