|
Actually he write the wrong code and I just do write his wrong code to explain him where he is wrong. I just explain him that his code is not working. LOL
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Thank you very much, Shilpi.
If we dream, every thing is possible!
|
|
|
|
|
Most Welcome
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Thans Shilpi.
I'm so sorry.It's my fault.
I have edited my post...
If we dream, every thing is possible!
|
|
|
|
|
Its ok dealon He also dont know about this.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
How to hide and show the radio button at run time?
e.g on button click, hide/show radio button.
|
|
|
|
|
ShowWindow(SW_HIDE) and ShowWindow(SW_SHOW)
|
|
|
|
|
Can any one gv one example
|
|
|
|
|
Consider IDC_RADIO is the control ID of your Radio buton.
So for hidig use the following
GetDlgItem(IDC_RADIO)->ShowWindow(SW_HIDE);
For showing the hidden control use the following
GetDlgItem(IDC_RADIO)->ShowWindow(SW_SHOW);
akt
|
|
|
|
|
CWnd *pRadioBtn = GetDlgItem(IDC_RADIO1);
pRadioBtn->ShowWindow(SW_SHOW);//SW_HIDE for hiding.
If you have control variables added as class members.
m_btnRadio1.ShowWindow(SW_SHOW);//m_btnRadio1 is control variable associated with IDC_RADIO1.
Regards,
Sandip.
|
|
|
|
|
Oh you want to use a function is this hard to use GetDlgItem(IDC_RADIO1)->ShowWindow(SW_SHOW); ?
|
|
|
|
|
pleaaaaaaase !
this has already been said.
why would you re reply it again ?!
|
|
|
|
|
No it was not reply,he or she needs to a line code?
|
|
|
|
|
|
They answered to he/she so I used of small style I said previous it was not reply, for example I could said: you can use of WM_SHOWWINDOW!
|
|
|
|
|
Hamid. wrote: They asnwered to he/she so I used of small style I said it was not reply for example I could said: you can use of WM_SHOWWINDOW!
I understand that you are not a native english speaker (neither do I) but please, put some extra effort when replying. Use punctuation and things like this. Honnestly, I more or less understand half of your posts. For example, I looked at your sentence for one minute but I couldn't guess what the hell you're talking about
I don't say that to hurt you, but it doesn't make a lot of sense to post if nobody understands you...
|
|
|
|
|
I wrote the following code to save bitmap to a file. But what i am getting is a black image. This is my code Any suggestions
HWND hParent=NULL,hChild = NULL;
bool bRet = IsProcessRunning("view.exe");
hParent = ::FindWindow("WindowViewer", NULL);
counter++;
if (!hParent)
{
AfxMessageBox("not able to find WindowViewer class");
}
if(hParent)
hChild = ::FindWindowEx(hParent,NULL,"ViewPU",NULL);
if (!hChild)
{
AfxMessageBox("not able to find ViewPU class",NULL,NULL);
}
::SendMessage(hChild, WM_SYSCOMMAND, SC_HOTKEY, (LPARAM) hChild);
::SendMessage(hChild, WM_SYSCOMMAND, SC_RESTORE, (LPARAM) hChild);
::ShowWindow(hChild, SW_SHOWNORMAL);
::SetForegroundWindow(hChild);
::SetFocus(hChild);
RECT rc;
BYTE* m_pDrawingSurfaceBits=NULL;
BITMAPINFOHEADER bmpInfoHeader = {0};;
HBITMAP hbmDIBSection = NULL;
char* szAppName = "view.exe";
bRet = IsProcessRunning(szAppName);
if (!bRet)
{
::MessageBox(NULL,"Application is not running",NULL,NULL);
}
::SendMessage(hChild, WM_SYSCOMMAND, SC_HOTKEY, (LPARAM) hChild);
::SendMessage(hChild, WM_SYSCOMMAND, SC_RESTORE, (LPARAM) hChild);
::GetWindowRect(hChild, &rc);
HDC hDC = ::GetDC(hChild);
HDC hSrcMemDC = CreateCompatibleDC(hDC);
HDC hDstMemDC = CreateCompatibleDC(hDC);
long width = rc.right-rc.left;
long height = rc.bottom-rc.top;
bmpInfoHeader.biSize = sizeof(BITMAPINFOHEADER);
bmpInfoHeader.biBitCount = 24;
bmpInfoHeader.biPlanes = 1;
bmpInfoHeader.biCompression = BI_RGB;
bmpInfoHeader.biWidth =width;
bmpInfoHeader.biHeight = height;
bmpInfoHeader.biSizeImage = ((((bmpInfoHeader.biWidth * bmpInfoHeader.biBitCount) + 31) & ~31) >> 3) * bmpInfoHeader.biHeight;
hbmDIBSection = CreateDIBSection(hDC, (CONST BITMAPINFO*)&bmpInfoHeader, DIB_RGB_COLORS, (void**)&m_pDrawingSurfaceBits, NULL, 0);
HBITMAP hbmOld = (HBITMAP) SelectObject(hSrcMemDC, hbmDIBSection);
bRet = BitBlt(hDstMemDC,0,0,width,height,hSrcMemDC,0,0,SRCCOPY);
if (bRet == 0) {
DWORD d=::GetLastError();
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL
);
::MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
::KillTimer(NULL,idTimer);}
BITMAPFILEHEADER bfh = {0};
bfh.bfType = 0X4D42;
bfh.bfOffBits = sizeof(BITMAPINFOHEADER)+sizeof(BITMAPFILEHEADER);
bfh.bfSize = bfh.bfOffBits+bmpInfoHeader.biSizeImage;
bRet = SetCurrentDirectory("c:\\testBitmap");
DWORD ret = GetLastError();
char filename[200];
char *temp = "test";
char *dir= "c:\\testBitmap\\";
int j;
j = sprintf(filename,"%s",dir);
j+= sprintf(filename+j,"%s",temp);
j+= sprintf(filename+j,"%d",counter);
j+= sprintf(filename+j,"%s",".bmp");
HANDLE hFile = CreateFile(filename,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
if (!hFile)
{
return ;
}
DWORD dwWritten = 0;
bRet = WriteFile(hFile,&bfh,sizeof(bfh),&dwWritten,NULL);
bRet = WriteFile(hFile,&bmpInfoHeader,sizeof(bmpInfoHeader),&dwWritten,NULL);
bRet = WriteFile(hFile,m_pDrawingSurfaceBits,bmpInfoHeader.biSizeImage,&dwWritten,NULL);
bRet = CloseHandle(hFile);
SelectObject(hSrcMemDC, hbmOld);
DeleteDC(hSrcMemDC);
|
|
|
|
|
Instead of this big code Cant you use GDI+
or you dont want to use GDI+?
Regards,
Sandip.
|
|
|
|
|
this application is developed in window sdk. So we have to use sdk only
|
|
|
|
|
subramanyeswari wrote: But what i am getting is a black image
Since you never assign m_pDrawingSurfaceBits buffer with image data, I think it is the correct result.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
i am getting the data in the following line. I debugged and checked
hbmDIBSection = CreateDIBSection(hDC, (CONST BITMAPINFO*)&bmpInfoHeader, DIB_RGB_COLORS, (void**)&m_pDrawingSurfaceBits, NULL, 0);
Regards
|
|
|
|
|
OK and what say the debugger about the values inside the m_pDrawingSurfaceBits buffer?
I guess they are all zeroes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Do you want to use of this code for save bitmap or you can use of other way?
|
|
|
|
|
I don't mind using the other code as long it is in SDK
Regards
|
|
|
|
|
I am reading a file and getting the key and values. I am putting the keys and values in the map. When I run the program I get many number of warnings
like...
warningC4786: 'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,
std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<cha
r,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Kfn,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::basi
c_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46) : see reference to class template instantiation 'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<std::basic_string<char,std::char_traits<
char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<cha
r> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Kfn,std::less<std::basic_string<char,std::char_traits<char>,std::allocato
r<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' being compiled
F:\Main Project\Coding\DLL_logging_Utility\properties.cpp(41) : see reference to class template instantiation 'std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::a
llocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' being compiled
THANKS
|
|
|
|
|