Click here to Skip to main content
15,885,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 1:39
professionalsteve_949661330-Sep-19 1:39 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
#realJSOP30-Sep-19 2:02
mve#realJSOP30-Sep-19 2:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:30
professionalsteve_949661330-Sep-19 2:30 
AnswerRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 27-Sep-19 1:08
professional dan!sh 27-Sep-19 1:08 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661327-Sep-19 1:52
professionalsteve_949661327-Sep-19 1:52 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
dan!sh 29-Sep-19 23:02
professional dan!sh 29-Sep-19 23:02 
GeneralRe: [VS2008 - Compact Framework] How to prevent a closed form from been disposed Pin
steve_949661330-Sep-19 2:18
professionalsteve_949661330-Sep-19 2:18 
QuestionHow to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 1:42
Member 1305673426-Sep-19 1: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 2:02
mveRichard Deeming26-Sep-19 2:02 
GeneralRe: How to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 2:10
Member 1305673426-Sep-19 2:10 
GeneralRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 2:14
mveRichard Deeming26-Sep-19 2:14 
AnswerRe: How to press a key with TranslateMessage Pin
OriginalGriff26-Sep-19 2:23
mveOriginalGriff26-Sep-19 2:23 
QuestionChanging many projects from AnyCPU to x64 Pin
Bernhard Hiller24-Sep-19 22:04
Bernhard Hiller24-Sep-19 22:04 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
OriginalGriff24-Sep-19 22:29
mveOriginalGriff24-Sep-19 22:29 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot24-Sep-19 23:33
harold aptroot24-Sep-19 23:33 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller25-Sep-19 0:11
Bernhard Hiller25-Sep-19 0:11 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
jkirkerx25-Sep-19 13:47
professionaljkirkerx25-Sep-19 13:47 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
Richard MacCutchan25-Sep-19 21:43
mveRichard MacCutchan25-Sep-19 21:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller26-Sep-19 21:43
Bernhard Hiller26-Sep-19 21:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot27-Sep-19 23:35
harold aptroot27-Sep-19 23:35 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller29-Sep-19 21:48
Bernhard Hiller29-Sep-19 21:48 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
AntGamble15-Oct-19 21:40
AntGamble15-Oct-19 21:40 
QuestionHow to properly close a JSON Post using RestSharp? Pin
mlong3024-Sep-19 13:25
mlong3024-Sep-19 13:25 
AnswerRe: How to properly close a JSON Post using RestSharp? Pin
BillWoodruff24-Sep-19 16:06
professionalBillWoodruff24-Sep-19 16:06 
QuestionLINQ: Remove first entry of groups in a list Pin
Mc_Topaz23-Sep-19 3:20
Mc_Topaz23-Sep-19 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.