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. html dialog

html dialog

Scheduled Pinned Locked Moved C / C++ / MFC
htmltutorialquestion
5 Posts 4 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.
  • N Offline
    N Offline
    Natural_Demon
    wrote on last edited by
    #1

    hello, i have made a dialog with HTML and my question how to prevent if u press enter that the app closes itself. HRESULT Cmfc2htmlDlg::OnButtonOK(IHTMLElement* /*pElement*/) { OnOK(); return S_OK; } HRESULT Cmfc2htmlDlg::OnButtonCancel(IHTMLElement* /*pElement*/) { OnCancel(); return S_OK; } what do i need to do, so it doesn't close if u press the enter bottun on your keyboard. kind regards, marco

    M F 2 Replies Last reply
    0
    • N Natural_Demon

      hello, i have made a dialog with HTML and my question how to prevent if u press enter that the app closes itself. HRESULT Cmfc2htmlDlg::OnButtonOK(IHTMLElement* /*pElement*/) { OnOK(); return S_OK; } HRESULT Cmfc2htmlDlg::OnButtonCancel(IHTMLElement* /*pElement*/) { OnCancel(); return S_OK; } what do i need to do, so it doesn't close if u press the enter bottun on your keyboard. kind regards, marco

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      See the FAQ: 7.4 How do I prevent a dialog from closing when the user presses Enter or Esc?[^] -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

      N 1 Reply Last reply
      0
      • M Michael Dunn

        See the FAQ: 7.4 How do I prevent a dialog from closing when the user presses Enter or Esc?[^] -- I'm Michael Dunn and I approve this post. Vote Trogdor in oh-four!

        N Offline
        N Offline
        Natural_Demon
        wrote on last edited by
        #3

        thnx, normaly i find anything on google, but i was lazy and i tried somany things thank u kind regards, marco Bad = knowing 2 much

        1 Reply Last reply
        0
        • N Natural_Demon

          hello, i have made a dialog with HTML and my question how to prevent if u press enter that the app closes itself. HRESULT Cmfc2htmlDlg::OnButtonOK(IHTMLElement* /*pElement*/) { OnOK(); return S_OK; } HRESULT Cmfc2htmlDlg::OnButtonCancel(IHTMLElement* /*pElement*/) { OnCancel(); return S_OK; } what do i need to do, so it doesn't close if u press the enter bottun on your keyboard. kind regards, marco

          F Offline
          F Offline
          faroqtam
          wrote on last edited by
          #4

          you can do this with many ways as follows:- 1- Yourclass::OnOk() { // make it empty } 2- use SetwindowHookEx function to capture Keyboard keys and u can compare the wpararm parameter in your callback function if it =13 then Enter key has been pressed and you can do any thing you need. after this if broblem is found contact me on faroq_tam2004@yahoo to send to you some source code faroq from yemen thammar working in thammar universty and my intersted about network and security im programmer from 6 years ago and ihave my B.C from this universty

          C 1 Reply Last reply
          0
          • F faroqtam

            you can do this with many ways as follows:- 1- Yourclass::OnOk() { // make it empty } 2- use SetwindowHookEx function to capture Keyboard keys and u can compare the wpararm parameter in your callback function if it =13 then Enter key has been pressed and you can do any thing you need. after this if broblem is found contact me on faroq_tam2004@yahoo to send to you some source code faroq from yemen thammar working in thammar universty and my intersted about network and security im programmer from 6 years ago and ihave my B.C from this universty

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            faroqtam wrote: use SetwindowHookEx function to capture Keyboard keys You must be kidding. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

            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