[RESOLVED] Dialog Based application icon
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: [RESOLVED] Dialog Based application icon

  1. #1
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    [RESOLVED] Dialog Based application icon

    How do I set the taskbar scrolling icon for a Dialog based application window. I need to set the icon which is displayed while user press ALT+TAB to switch between multiple open window. Usually it's done by
    Code:
    wc.hIconSm= LoadIcon (...)
    while registering window class.. but how to achieve the same for dialog based application. I'm able to set title bar and exe icons by
    Code:
    SendMessage(hMain, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)hIcon);
    but what should I do for that icon ??

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: Dialog Based application icon

    Are you using MFC?

  3. #3
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    No.. win32 api..

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: Dialog Based application icon

    Okay, in the future, can you post Win32 questions in the C++ and WinAPI forum? The Visual C++ forum is for VC questions related to MFC, WTL and ATL.

  5. #5
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    See.. I can.. but in the VC++ forum we are getting replies more faster...

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: Dialog Based application icon

    You'll save me the trouble of moving it, if you post it in the correct forum. Thanks.

  7. #7
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    Re: Dialog Based application icon

    Quote Originally Posted by hypheni View Post
    See.. I can.. but in the VC++ forum we are getting replies more faster...
    Nope, this is not true. Just more posts in VC++ forum make the VC++ forum queue longer.

    Please, as much as possible, put your question(s) in the most appropriate forum and not in the "most rated" one.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  8. #8
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    okaay.. now can anyone tell me the solution...

  9. #9
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    56 Views but no new posts.. thats why I do not like to post in this forum..

    @modarators
    If I post non MFC topics in VC++ forum and people used to give some useful replies on that what is the wrong in that. Please do not move any post here. Its a request.

  10. #10
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: Dialog Based application icon

    Quote Originally Posted by hypheni View Post
    Please do not move any post here. Its a request.
    It doesn't work that way. Please post in the proper forum as we've politely asked you to. If you are a bit patient then someone will answer in this forum.

  11. #11
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: Dialog Based application icon

    I looked around the internet and didn't find any obvious samples. The problem is that native Win32 programming is getting pretty old.

    At any rate, I'd recommend getting the book "Programming Windows, 5th Edition by Charles Petzold". It's the standard when it comes to native Win32 programming.

  12. #12
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    ya. I own a e-copy of that book.. but that doesn't provide any such info regarding this. and also google cant help me to solve this.

  13. #13
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Dialog Based application icon

    Okay. I have solved it. Actually I did it before but forget. Here is the code. May this will help others in future.

    Code:
    SetClassLong(hMain, GCL_HICON, (LONG)LoadIcon(hIns, (MAKEINTRESOURCE)IDI_ICON1));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center