images on windowss.

Dec 6, 2018 at 11:39pm
Hi, i am using the windows.h library, and I've had some difficulties with this. I am trying to show a image in my graphical interface. My program is working, but the image dont is showed. The program compile and execute.
I think the bitmap what i am trying to show dont was on the right folder, or the way to the image was wrong. Can anyone show me an example to try to see what is wrong or help me with other metod? Thanks!!

hLogo = (L"Static",NULL,WS_VISIBLE | WS_CHILD | SS_BITMAP, 150, 120, 150 , 20,hWnd,NULL,NULL,NULL);
SendMessageW(hLogo,STM_SETIMAGE,IMAGE_BITMAP,(LPARAM) hLogoImage);
}

void loadImages()
{

hLogoImage = (HBITMAP)LoadImageW(NULL, L"Logo.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);

}

Dec 7, 2018 at 7:54am
Check the return value of LoadImage.
Dec 7, 2018 at 12:09pm
How I do this? I am very beginning
Dec 7, 2018 at 1:44pm
1
2
3
4
5
6
7
8
  if (hLogoImage == NULL)
  {
    MessageBoxA(NULL, "Error loading image", "ERROR!", MB_OK);
  }
  else
  {
    // draw your image here
  }
Dec 7, 2018 at 4:43pm
I put it on my code, compile and execute, and nothing is changed. This significe they return the else, but the image don't was shown.
Dec 7, 2018 at 4:49pm
I don't use windows, but this can't possibly be correct:
 
hLogo = (L"Static",NULL,WS_VISIBLE | WS_CHILD | SS_BITMAP, 150, 120, 150 , 20,hWnd,NULL,NULL,NULL);

Dec 7, 2018 at 5:13pm
tpb, indeed. I assume detro is trying to create a child window?

 
hLogo = CreateWindow(L"Static",NULL,WS_VISIBLE | WS_CHILD | SS_BITMAP, 150, 120, 150 , 20,hWnd,NULL,NULL,NULL);

(Not tested)

http://forums.codeguru.com/showthread.php?491604-Windows-SDK-What-is-a-child-window
Last edited on Dec 7, 2018 at 5:15pm
Dec 7, 2018 at 5:20pm
No, I am trying to put a bitmap image on my window.
Last edited on Dec 7, 2018 at 5:22pm
Dec 7, 2018 at 6:02pm
Oh, I was doing a error of principiant. The error is so idiot that I dont want nor to show what I was doing wrong for you, hahaha. Thanks for the help!!
Topic archived. No new replies allowed.