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. ShowWindow

ShowWindow

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 3 Posters 1 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.
  • L Offline
    L Offline
    leifmikael
    wrote on last edited by
    #1

    My minimized program doesn't display when an alarmfunction in the program call ShowWindow(hwnd, SW_MAXIMIZE); What's mising?:confused:

    L 1 Reply Last reply
    0
    • L leifmikael

      My minimized program doesn't display when an alarmfunction in the program call ShowWindow(hwnd, SW_MAXIMIZE); What's mising?:confused:

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      could you be more explicit ? maybe you should try ShowWindow(hwnd,SW_SHOW)?


      "Go as far as you can see,and when you get there you'll see further" - Unknown

      L 1 Reply Last reply
      0
      • L Lost User

        could you be more explicit ? maybe you should try ShowWindow(hwnd,SW_SHOW)?


        "Go as far as you can see,and when you get there you'll see further" - Unknown

        L Offline
        L Offline
        leifmikael
        wrote on last edited by
        #3

        I have done a windows prg with an alarm function (checking date and time), then i minimize the prg with the MINIMIZEBOX and the prg should activate and display the window at correct time and date, but it doesnt.t work, I have tried all kind of ShowWindod codes, i think there is something else i'm missing.

        L 1 Reply Last reply
        0
        • L leifmikael

          I have done a windows prg with an alarm function (checking date and time), then i minimize the prg with the MINIMIZEBOX and the prg should activate and display the window at correct time and date, but it doesnt.t work, I have tried all kind of ShowWindod codes, i think there is something else i'm missing.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          can you show the code ?


          "Go as far as you can see,and when you get there you'll see further" - Unknown

          L 1 Reply Last reply
          0
          • L Lost User

            can you show the code ?


            "Go as far as you can see,and when you get there you'll see further" - Unknown

            L Offline
            L Offline
            leifmikael
            wrote on last edited by
            #5

            void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.

            L T 2 Replies Last reply
            0
            • L leifmikael

              void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              i think the problem is no in the ShowWindow(..) function, i'd suggest you to replace it with simple MessageBox("") function just to check that these functions alarmchecknotesamling(..) , getTime(..) are correctly implemented.

              void checkalarm()
              {
              getTime(date);
              if (notesamling.alarmchecknotesamling (date))
              {
              MessageBox("Whatever");
              }

              }


              "Go as far as you can see,and when you get there you'll see further" - Unknown

              L 1 Reply Last reply
              0
              • L Lost User

                i think the problem is no in the ShowWindow(..) function, i'd suggest you to replace it with simple MessageBox("") function just to check that these functions alarmchecknotesamling(..) , getTime(..) are correctly implemented.

                void checkalarm()
                {
                getTime(date);
                if (notesamling.alarmchecknotesamling (date))
                {
                MessageBox("Whatever");
                }

                }


                "Go as far as you can see,and when you get there you'll see further" - Unknown

                L Offline
                L Offline
                leifmikael
                wrote on last edited by
                #7

                I have already tried that and it don't work. But the functions work when the prg window is active and displayed. Isn't true that the prg still working in minimized mode or is there any difference.

                T 1 Reply Last reply
                0
                • L leifmikael

                  I have already tried that and it don't work. But the functions work when the prg window is active and displayed. Isn't true that the prg still working in minimized mode or is there any difference.

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #8

                  leifmikael wrote: Isn't true that the prg still working in minimized mode or is there any difference. Yes program will be working in minized Mode, instead of SW_SHOW try SW_RESTORE.

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta

                  1 Reply Last reply
                  0
                  • L leifmikael

                    void checkalarm() { getTime(date); if (notesamling.alarmchecknotesamling (date)) {ShowWindow(hwnd, SW_SHOW);} } This is the part of the code that should activate and display the window.

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #9

                    leifmikael wrote: ShowWindow(hwnd, SW_SHOW);} Is hwnd is global variable?. Have you check hwnd hold the valid value? Try IsWindow() function to check wheather hwnd point to valid window or not

                    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                    cheers, Alok Gupta

                    L 1 Reply Last reply
                    0
                    • T ThatsAlok

                      leifmikael wrote: ShowWindow(hwnd, SW_SHOW);} Is hwnd is global variable?. Have you check hwnd hold the valid value? Try IsWindow() function to check wheather hwnd point to valid window or not

                      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                      cheers, Alok Gupta

                      L Offline
                      L Offline
                      leifmikael
                      wrote on last edited by
                      #10

                      The problem was in the messages handling, i belive. I changed to PeekMessage from GetMessage. is this Ok? while (true) { if(PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&message); DispatchMessage(&message); } checkalarm(); // func.to check if the window is to restore } return message.wParam; } return message.wParam; }

                      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