Click here to Skip to main content
14,975,726 members
Home / Discussions / C#
   

C#

 
GeneralRe: Way to retain focus of transparent form application. Pin
parth_patel19-Jun-09 8:55
Memberparth_patel19-Jun-09 8:55 
GeneralRe: Way to retain focus of transparent form application. Pin
EliottA19-Jun-09 9:26
MemberEliottA19-Jun-09 9:26 
GeneralRe: Way to retain focus of transparent form application. Pin
parth_patel19-Jun-09 12:30
Memberparth_patel19-Jun-09 12:30 
GeneralRe: Way to retain focus of transparent form application. Pin
S. Senthil Kumar20-Jun-09 18:11
MemberS. Senthil Kumar20-Jun-09 18:11 
GeneralRe: Way to retain focus of transparent form application. Pin
Dave Kreskowiak19-Jun-09 10:37
mveDave Kreskowiak19-Jun-09 10:37 
GeneralRe: Way to retain focus of transparent form application. Pin
parth_patel19-Jun-09 12:29
Memberparth_patel19-Jun-09 12:29 
AnswerRe: Way to retain focus of transparent form application. [modified] Pin
crayzeecoder19-Jun-09 9:30
Membercrayzeecoder19-Jun-09 9:30 
GeneralRe: Way to retain focus of transparent form application. Pin
parth_patel19-Jun-09 12:24
Memberparth_patel19-Jun-09 12:24 
This does not work. I tried this one as well as the

  [DllImport("user32", CharSet = CharSet.Auto)]<br />
        private extern static int SendMessage(<br />
           IntPtr handle, int msg, int wParam, IntPtr lParam);<br />
<br />
        [DllImport("user32", CharSet = CharSet.Auto)]<br />
        private extern static int PostMessage(<br />
            IntPtr handle, int msg, int wParam, IntPtr lParam);<br />
<br />
        private const int WM_ACTIVATE = 0x006;<br />
        private const int WM_ACTIVATEAPP = 0x01C;<br />
        private const int WM_NCACTIVATE = 0x086;<br />
<br />
<br />
        /// <summary><br />
        /// Subclasses the owning form's existing Window Procedure to enables the <br />
        /// title bar to remain active when a popup is show, and to detect if<br />
        /// the user clicks onto another application whilst the popup is visible.<br />
        /// </summary><br />
        /// <param name="m">Window Procedure Message</param><br />
        protected override void WndProc(ref Message m)<br />
        {<br />
            <br />
                // check for WM_ACTIVATEAPP and WM_NCACTIVATE<br />
                if (m.Msg == WM_NCACTIVATE)<br />
                {<br />
                    <br />
                    // Check if the title bar will made inactive:<br />
                    if (((int)m.WParam) == 0)<br />
                    {<br />
                        xyz += m.Msg + " ";<br />
                        // If so reactivate it.<br />
                        SendMessage(this.Handle, WM_NCACTIVATE, 1, IntPtr.Zero);<br />
<br />
                        // Note it's no good to try and consume this message;<br />
                        // if you try to do that you'll end up with windows<br />
                        // that don't respond.<br />
                    }<br />
<br />
                }<br />
                else if (m.Msg == WM_ACTIVATEAPP)<br />
                {<br />
                   <br />
                    // Check if the application is being deactivated.<br />
                    if ((int)m.WParam == 0)<br />
                    {<br />
                        xyz += m.Msg + " ";<br />
                        // And put the title bar into the inactive state:<br />
                        PostMessage(this.Handle, WM_NCACTIVATE, 0, IntPtr.Zero);<br />
                    }<br />
                }<br />
                <br />
                base.WndProc(ref m);<br />
        } 


code.

Later code actually does the reverse of what I want, but still it does not work.

Neither works.
QuestionConfigurationManager - how to read/write into a custom section? Pin
Zeokat19-Jun-09 7:27
MemberZeokat19-Jun-09 7:27 
AnswerRe: ConfigurationManager - how to read/write into a custom section? Pin
Manas Bhardwaj19-Jun-09 9:37
professionalManas Bhardwaj19-Jun-09 9:37 
GeneralRe: ConfigurationManager - how to read/write into a custom section? Pin
Zeokat19-Jun-09 9:48
MemberZeokat19-Jun-09 9:48 
AnswerRe: ConfigurationManager - how to read/write into a custom section? Pin
Henry Minute19-Jun-09 10:18
MemberHenry Minute19-Jun-09 10:18 
GeneralRe: ConfigurationManager - how to read/write into a custom section? Pin
Zeokat19-Jun-09 10:34
MemberZeokat19-Jun-09 10:34 
QuestionReplace Function Pin
Vimalsoft(Pty) Ltd19-Jun-09 7:01
professionalVimalsoft(Pty) Ltd19-Jun-09 7:01 
AnswerRe: Replace Function Pin
musefan19-Jun-09 7:14
Membermusefan19-Jun-09 7:14 
GeneralRe: Replace Function Pin
Vimalsoft(Pty) Ltd19-Jun-09 7:23
professionalVimalsoft(Pty) Ltd19-Jun-09 7:23 
GeneralRe: Replace Function Pin
Luc Pattyn19-Jun-09 7:34
sitebuilderLuc Pattyn19-Jun-09 7:34 
AnswerRe: Replace Function Pin
Luc Pattyn19-Jun-09 7:33
sitebuilderLuc Pattyn19-Jun-09 7:33 
GeneralRe: Replace Function Pin
Vimalsoft(Pty) Ltd19-Jun-09 7:36
professionalVimalsoft(Pty) Ltd19-Jun-09 7:36 
GeneralRe: Replace Function Pin
musefan19-Jun-09 7:38
Membermusefan19-Jun-09 7:38 
GeneralRe: Replace Function Pin
Vimalsoft(Pty) Ltd19-Jun-09 7:39
professionalVimalsoft(Pty) Ltd19-Jun-09 7:39 
GeneralRe: Replace Function Pin
Luc Pattyn19-Jun-09 7:43
sitebuilderLuc Pattyn19-Jun-09 7:43 
GeneralRe: Replace Function Pin
Vimalsoft(Pty) Ltd19-Jun-09 7:48
professionalVimalsoft(Pty) Ltd19-Jun-09 7:48 
GeneralRe: Replace Function Pin
musefan19-Jun-09 7:37
Membermusefan19-Jun-09 7:37 
GeneralRe: Replace Function Pin
Luc Pattyn19-Jun-09 7:45
sitebuilderLuc Pattyn19-Jun-09 7:45 

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.