|
hum, yes your right...
what about LoadModule() ? (or smthing similar ? )
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Check out for this api
[ExtractIcon]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I get nice results by using SendMessage with WM_GETICON. If that is invalid there is always GetClassLong with an index of GCL_HICON.
HICON icon;
icon = (HICON) ::SendMessage(hwnd, WM_GETICON, ICON_SMALL, 0);
icon = (HICON) ::GetClassLong(hwnd, GCL_HICON);
|
|
|
|
|
thats it! thanks a lot! )
hIcon = (HICON)::SendMessage(hwnd, WM_GETICON, ICON_BIG, 0);
if(hIcon == NULL)
hIcon = (HICON)::GetClassLong(hwnd, GCL_HICON);
if(hIcon == NULL)
hIcon = (HICON)::GetClassLong(::GetParent(hwnd), GCL_HICON);
works - no just looking when hIcon is still NULL, if there is a ICON_SMALL )
cheers and thanx
vertex_x
|
|
|
|
|
thanks friend this helped me too...
|
|
|
|
|
Hi guys
I am facing a problem on how to make the Bitmap Added without disappearing when i minimize or maximize screen or just moving the program. My Bitmap graphics always disappear, i do not know how to use UpdateWindow Function to prevent this from happening can i have any demo projects that can guide me through this problem
Thank You
|
|
|
|
|
Hi,
Did you tried to redraw the bitmap window?
In your OnPaint() function try : m_BitmapWindow.RedrawWindow();
Regards,
Eli
|
|
|
|
|
I did not use OnPaint Function to create the bitmaps
I created a ShowBitmap(int x, int y, int type) function and some parameters for displaying the Bitmap, so what kind of other Functions would you recommend for me? Can UpdateWindows() be use?
|
|
|
|
|
I did not use OnPaint Function to create the bitmaps
I created a ShowBitmap(int x, int y, int type) function and some parameters for displaying the Bitmap, so what kind of other Functions would you recommend for me? Can UpdateWindows() be use?
|
|
|
|
|
Sorry what are the requirements i need to do before using this m_Bitmap.RedrawWindow();
Should i declare CDC m_Bitmap or CBitmap m_Bitmap?
|
|
|
|
|
Hi everybody, I am developing an Browser Helper Object. I want to get the data sent by the POST method on the NavigateComplete event. How can I do that? Hope to see your reply soon! Thanks.
|
|
|
|
|
Hello Everyone,
Can someone please tell a way to create tracking tooltip. Please note I have already tried the MSDN Libary tracking tooltips code, but failed to achieve the objective. Kindly help.
Regars
Ashwin
|
|
|
|
|
What was the problem with the MSDN code?
Medication for us all
You think you know me, well you're wrong
|
|
|
|
|
Hello Thanks for the Reply,
Have you tried the code. If so please paste your function here, I would be very much greatful to you. As far as my try goes I do get a tracking rectangle follwing my mouse but it keeps blinking all the time I move the mouse and without the text I pasted in the code.
bool g_bIsVisible;
HWND g_hwndTT;
void CTestDlg::TooltipFunc()
{
INITCOMMONCONTROLSEX icex;
HWND hwndTT;
TOOLINFO ti;
// Load the tooltip class from the DLL.
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_BAR_CLASSES;
if(!InitCommonControlsEx(&icex))
return NULL;
RECT rect;
GetClientRect (&rect);
// Create the tooltip control.
hwndTT = CreateWindow(TOOLTIPS_CLASS, TEXT(""),
WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, (HMENU)NULL, AfxGetApp()->m_hInstance,
NULL);
// Prepare TOOLINFO structure for use as tracking tooltip.
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
ti.hwnd = m_hWnd;
ti.uId = (UINT)m_hWnd;
ti.hinst = AfxGetApp()->m_hInstance;
ti.lpszText = "Hello World";
ti.rect.left = ti.rect.top = ti.rect.bottom = ti.rect.right = 0;
// Add the tool to the control, displaying an error if needed.
if(!::SendMessage(hwndTT,TTM_ADDTOOL,0,(LPARAM)&ti)){
MessageBox("Couldn't create the tooltip control.",
"Error",MB_OK);
return NULL;
}
// Activate (display) the tracking tooltip. Then, set a global
// flag value to indicate that the tooltip is active, so other
// functions can check to see if it's visible.
::SendMessage(hwndTT,TTM_TRACKACTIVATE,(WPARAM)TRUE,(LPARAM)&ti);
g_bIsVisible = TRUE;
g_hwndTT = hwndTT;
}
void CTestDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(g_bIsVisible){
#define X_OFFSET 15
#define Y_OFFSET X_OFFSET
POINT m_point;
::GetCursorPos(&m_point);
::SendMessage(g_hwndTT,
TTM_TRACKPOSITION,
0,
(LPARAM)MAKELPARAM(m_point.x + X_OFFSET,
m_point.y + Y_OFFSET));
}
CDialog::OnMouseMove(nFlags, point);
}
BOOL CTestDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
LPNMTTDISPINFO lpnmtdi = (LPNMTTDISPINFO) lParam;
strcpy (lpnmtdi->szText, "Hello World");
return CDialog::OnNotify(wParam, lParam, pResult);
}
Regards
Ashwin
|
|
|
|
|
I am using following Code to Copy to Clip board.
This code is written under a button Copy ,
As i click on it first time it Works fine , and i can paste it in MS word.
As I clik 2nd time on Copy Botton . the Application Crashes down.
It crashes on statment pData->SetClipboard();
void CopyButton()
{
// Get DC
CDC* dcRef = GetDC();
tagSTGMEDIUM * data;
data = new tagSTGMEDIUM;
CMetaFileDC * dcMeta;
dcMeta = new CMetaFileDC();
if(!dcMeta)
{
AfxMessageBox("Unable to Load data on Clipboard");
return;
}
COleDataSource* pData = new COleDataSource;
//replace "ImageName" with a description of this image
dcMeta->CreateEnhanced(dcRef, NULL, NULL,"Cca-Graph" );
dcMeta->SetMapMode(MM_TEXT);
dcMeta->SetAttribDC(dcRef->m_hAttribDC);
//actually draw to the device context
CRect rcWnd;
GetClientRect(&rcWnd);
//draw meta file :: do what ever you want to do: bitmaps, lines, text...
DrawChart(dcMeta, rcWnd, false);
//done drawing
data->tymed = TYMED_ENHMF;
data->hEnhMetaFile = dcMeta->CloseEnhanced();
pData->CacheData( CF_ENHMETAFILE, data );
// Crashes
pData->SetClipboard();
// Release the meta file attributes
dcMeta->ReleaseAttribDC();
delete dcMeta;
delete data;
}
Regards.
|
|
|
|
|
I bet it's because you delete data. Once you call SetClipboard, data is no longer yours and windows handles it. When you call SetClipboard again, it's trying to delete the old pointer twice (because you already deleted it) which is bad.
|
|
|
|
|
HI
If i not Delete data , it also occured , i am very much confused why it is happening.
I am using Windows XP.
thanx
Regards.
|
|
|
|
|
What happens exactly? Are you ASSERTing or getting memory could not be read or what?
|
|
|
|
|
A crashing Error Occurs that windows XP usualy generates of Send or Dont Send
Regards.
|
|
|
|
|
zahid_ash wrote:
dcMeta->CreateEnhanced(dcRef, NULL, NULL,"Cca-Graph" );
Don't know if this has to do anything with your problem. But the documentation says : "The string pointed to by the lpszDescription parameter must contain a null character between the application name and the picture name and must terminate with two null characters —for example, "XYZ Graphics Editor\0Bald Eagle\0\0," where \0 represents the null character. If lpszDescription is NULL, there is no corresponding entry in the enhanced-metafile header."
suhredayan There is no spoon.
|
|
|
|
|
No your tip not works . sorry.
Program crashes before pData->SetClipboard(); when the its is copied 2nd time.
On first click it works ok , but on 2nd click it crashes
Regards.
|
|
|
|
|
I am sorry.
To get the result I displayed inthe previoous thread I wrote;
result.Format("%16I64d",(_int64*)GivenLongLong);
|
|
|
|
|
Using _int64 _atoi64(const char* string);
I wrote:
_int64 myLonLong=_atoi64("FFFFFFFFFFFFFFFF");//16 F
To display the result as a string:
CString result;
result.Format("%16I64d",myLongLong);
The result displayed is: 14 186 792 374 763 520
I am wondering if this is correct.
Thanks for any help.
|
|
|
|
|
This is incorrect. The range of an _int64 is –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. The problem however is that _atoi64 does not read in hex numbers, only decimal numbers.
|
|
|
|
|
Thanks very much.
What to do than to have a conversion of a LONGLONG from hexadecimal to decimal ?
|
|
|
|
|