Click here to Skip to main content
14,357,121 members
   

C#

 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:39
professionalsteve_949661330-Sep-19 2:39 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 3:02
mve#realJSOP30-Sep-19 3:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 3:30
professionalsteve_949661330-Sep-19 3:30 
AnswerRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 27-Sep-19 2:08
professional lw@zi 27-Sep-19 2:08 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661327-Sep-19 2:52
professionalsteve_949661327-Sep-19 2:52 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
lw@zi 30-Sep-19 0:02
professional lw@zi 30-Sep-19 0:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 3:18
professionalsteve_949661330-Sep-19 3:18 
QuestionHow to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 2:42
memberMember 1305673426-Sep-19 2:42 
Hi guys, im trying to use TranslateMessage to send a key to a external program, but im not having success so far..

My code is following:

[DllImport("user32.dll")]
        static extern bool TranslateMessage([In] ref MSG lpMsg);

        const int WM_KEYDOWN = 0x0100;
        const int WM_KEYUP = 0x0101;
        public struct MSG
        {
            public IntPtr hwnd;
            public uint message;
            public IntPtr wParam;
            public IntPtr lParam;
            public uint time;
            public POINT pt;
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct POINT
        {
            public int X;
            public int Y;

            public POINT(int x, int y)
            {
                this.X = x;
                this.Y = y;
            }
        }

        static void Main(string[] args)
        {
            Thread.Sleep(3000);
            MSG m = new MSG();
            m.message = 0x0D;
            //m.lParam = (IntPtr)WM_KEYDOWN;
            m.wParam = (IntPtr)WM_KEYDOWN;
            m.pt = new POINT();
            m.time = 0;
            
            bool p = TranslateMessage(ref m);
        }


as you can see im trying to send enter key for example but it does nothing..

thanks in advance
AnswerRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 3:02
mveRichard Deeming26-Sep-19 3:02 
GeneralRe: How to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 3:10
memberMember 1305673426-Sep-19 3:10 
GeneralRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 3:14
mveRichard Deeming26-Sep-19 3:14 
AnswerRe: How to press a key with TranslateMessage Pin
OriginalGriff26-Sep-19 3:23
protectorOriginalGriff26-Sep-19 3:23 
QuestionChanging many projects from AnyCPU to x64 Pin
Bernhard Hiller24-Sep-19 23:04
memberBernhard Hiller24-Sep-19 23:04 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
OriginalGriff24-Sep-19 23:29
protectorOriginalGriff24-Sep-19 23:29 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot25-Sep-19 0:33
memberharold aptroot25-Sep-19 0:33 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller25-Sep-19 1:11
memberBernhard Hiller25-Sep-19 1:11 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
jkirkerx25-Sep-19 14:47
professionaljkirkerx25-Sep-19 14:47 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
Richard MacCutchan25-Sep-19 22:43
protectorRichard MacCutchan25-Sep-19 22:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller26-Sep-19 22:43
memberBernhard Hiller26-Sep-19 22:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot28-Sep-19 0:35
memberharold aptroot28-Sep-19 0:35 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller29-Sep-19 22:48
memberBernhard Hiller29-Sep-19 22:48 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
AntGamble15-Oct-19 22:40
memberAntGamble15-Oct-19 22:40 
QuestionHow to properly close a JSON Post using RestSharp? Pin
mlong3024-Sep-19 14:25
membermlong3024-Sep-19 14:25 
AnswerRe: How to properly close a JSON Post using RestSharp? Pin
BillWoodruff24-Sep-19 17:06
mveBillWoodruff24-Sep-19 17:06 
QuestionLINQ: Remove first entry of groups in a list Pin
Mc_Topaz23-Sep-19 4:20
memberMc_Topaz23-Sep-19 4: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.