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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Hide window

Hide window

Scheduled Pinned Locked Moved C / C++ / MFC
design
3 Posts 3 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.
  • M Offline
    M Offline
    Manjunath S
    wrote on last edited by
    #1

    Dear all, I have dialog with two buttons(one is for automatic logon and one is for UI logon). when the user selects the UI logon the new dialog pops up with prompting username and password ,after user enter this data he clicks ok button to enter. But when press automatic logon ,i modified code to fill the default username and password (in username and password edit box),after this generate IDOK notification ,So that its logs automatically with out UI. But what i need is to hide this popup dialog(which prompts for username and password ) which comes when user press the automatic logon button( i tried to hide this window by using showwindow(hwnd,SW_HIDE) in WM_INIT notification (case WM_INITIALISE: ) in dialog procedure ,but this window flashs and disappears,Is their any way to HIDE this without showing this dialog to user when he press automatic logon)

    Manjunath S GESL Bangalore

    J E 2 Replies Last reply
    0
    • M Manjunath S

      Dear all, I have dialog with two buttons(one is for automatic logon and one is for UI logon). when the user selects the UI logon the new dialog pops up with prompting username and password ,after user enter this data he clicks ok button to enter. But when press automatic logon ,i modified code to fill the default username and password (in username and password edit box),after this generate IDOK notification ,So that its logs automatically with out UI. But what i need is to hide this popup dialog(which prompts for username and password ) which comes when user press the automatic logon button( i tried to hide this window by using showwindow(hwnd,SW_HIDE) in WM_INIT notification (case WM_INITIALISE: ) in dialog procedure ,but this window flashs and disappears,Is their any way to HIDE this without showing this dialog to user when he press automatic logon)

      Manjunath S GESL Bangalore

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      It would be cleaner if you could separate the logic of window creation from the logic of user input validation. This way, when automatical logging in, you only call the validation logic, without creating the window. I assume that you know the difference between instantiating a C++ window object and actually creating a window. If not, I'll explain more.

      Best, Jun

      1 Reply Last reply
      0
      • M Manjunath S

        Dear all, I have dialog with two buttons(one is for automatic logon and one is for UI logon). when the user selects the UI logon the new dialog pops up with prompting username and password ,after user enter this data he clicks ok button to enter. But when press automatic logon ,i modified code to fill the default username and password (in username and password edit box),after this generate IDOK notification ,So that its logs automatically with out UI. But what i need is to hide this popup dialog(which prompts for username and password ) which comes when user press the automatic logon button( i tried to hide this window by using showwindow(hwnd,SW_HIDE) in WM_INIT notification (case WM_INITIALISE: ) in dialog procedure ,but this window flashs and disappears,Is their any way to HIDE this without showing this dialog to user when he press automatic logon)

        Manjunath S GESL Bangalore

        E Offline
        E Offline
        eusto
        wrote on last edited by
        #3

        Quickes way: Setup the dialog fields in OnInitDialog() and then call OnOk or OnBnClickedOk() ...it's a quick thing but i don't like it verry much. A better way is to process the login info in a method not depending on UI. Just pass the login fields as params to your method. In this method, display the dialog if you need to (ie: your user did not check the autologin option or something). The best thing about this is that you can call the same method in your UI validation procedure afterwards.

        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