Trouble with STM_SETIMAGE!

This is a discussion on Trouble with STM_SETIMAGE! within the Windows Programming forums, part of the Platform Specific Boards category; I am having trouble with STM_SETIMAGE. Here's some code: HBITMAP loadSpec = (HBITMAP)LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(501), 335, 260, IMAGE_BITMAP, 0); hFrame=CreateWindow( "static", ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Exclamation Trouble with STM_SETIMAGE!

    I am having trouble with STM_SETIMAGE. Here's some code:


    HBITMAP loadSpec = (HBITMAP)LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(501), 335, 260, IMAGE_BITMAP, 0);


    hFrame=CreateWindow(
    "static",
    NULL,
    WS_CHILD | WS_VISIBLE | SS_BITMAP,
    0, 0, 335, 260,
    hwnd,
    0,
    0,
    0
    );

    SendMessage(hFrame, STM_SETIMAGE, (LPARAM)IMAGE_BITMAP, (WPARAM)loadSpec);


    Nothing happens! What's wrong?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Your LoadImage() parameters are in the wrong order. Stolen from MSDN -

    Code:
    HANDLE LoadImage(
      HINSTANCE hinst,   // handle to instance
      LPCTSTR lpszName,  // image to load
      UINT uType,        // image type
      int cxDesired,     // desired width
      int cyDesired,     // desired height
      UINT fuLoad        // load options
    );

  3. #3
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Exclamation Nevermind...

    Sorry, my mistake. I mixed up the params.
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trouble with assignment in C
    By mohanlon in forum C Programming
    Replies: 17
    Last Post: 06-23-2009, 11:44 AM
  2. Replies: 6
    Last Post: 01-03-2007, 03:02 PM
  3. Is it so trouble?
    By Yumin in forum Tech Board
    Replies: 4
    Last Post: 01-30-2006, 04:10 PM
  4. trouble scanning in... and link listing
    By panfilero in forum C Programming
    Replies: 14
    Last Post: 11-21-2005, 12:58 PM
  5. C++ program trouble
    By senrab in forum C++ Programming
    Replies: 7
    Last Post: 04-30-2003, 12:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21