Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to transparent MFC activeX control

how to transparent MFC activeX control

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelptutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    B0606115
    wrote on last edited by
    #1

    hi! i have made a dialog based(windowed) mfc activex control ,i want to make it transparent and again retain the previous state according to user choice.kindly help me. thanx in advance

    M 1 Reply Last reply
    0
    • B B0606115

      hi! i have made a dialog based(windowed) mfc activex control ,i want to make it transparent and again retain the previous state according to user choice.kindly help me. thanx in advance

      M Offline
      M Offline
      Member 3480232
      wrote on last edited by
      #2

      What do you mean make it transparent?

      B 1 Reply Last reply
      0
      • M Member 3480232

        What do you mean make it transparent?

        B Offline
        B Offline
        B0606115
        wrote on last edited by
        #3

        To make it transparent means to hide the dialog when required and unhide it(show it back)as required.

        M 1 Reply Last reply
        0
        • B B0606115

          To make it transparent means to hide the dialog when required and unhide it(show it back)as required.

          M Offline
          M Offline
          Member 3480232
          wrote on last edited by
          #4

          The way to do this is to use: ::ShowWindow( SW_HIDE or SW_SHOW ) Usually one would add a method to the control as: BOOL LogonDlg::SetVisibility( int nCmd ) {       BOOL bRet = ShowWindow( nCmd );       if( nCmd == SW_SHOW )      SetForegroundWindow();       return bRet; }

          B 1 Reply Last reply
          0
          • M Member 3480232

            The way to do this is to use: ::ShowWindow( SW_HIDE or SW_SHOW ) Usually one would add a method to the control as: BOOL LogonDlg::SetVisibility( int nCmd ) {       BOOL bRet = ShowWindow( nCmd );       if( nCmd == SW_SHOW )      SetForegroundWindow();       return bRet; }

            B Offline
            B Offline
            B0606115
            wrote on last edited by
            #5

            ::ShowWindow( SW_HIDE or SW_SHOW ) hides and show the control not the dialog. please tell me how to do it for a dialog. if u have done it by ::ShowWindow( SW_HIDE or SW_SHOW ) then kindly tell the detailed code of it.

            M 1 Reply Last reply
            0
            • B B0606115

              ::ShowWindow( SW_HIDE or SW_SHOW ) hides and show the control not the dialog. please tell me how to do it for a dialog. if u have done it by ::ShowWindow( SW_HIDE or SW_SHOW ) then kindly tell the detailed code of it.

              M Offline
              M Offline
              Member 3480232
              wrote on last edited by
              #6

              The ShowWindow API can be used inside any dialog. There is no more to it than just that. It is usually made a part of a method which also includes the SetForegroundWindow but that is all. Experiment with it. Its the only way to become familiar with something. As for the theory: A modeless dialog is a window that has no exclusive rights to system resources such as the cursor. It can remain on the desktop in a hidden state while the rest of the control is active and busy with other things and can be hidden and brought to the foreground at will. I think that in your case the control is only a dialog and that is why you perceive the control to be hidden and shown. That is not true. The control cannot be hidden because running code does not subscribe to the concept of being hidden etc. Only a GUI element can go through these states and that is what ShowWindow is designed for.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups