|
Well, you could search all of the .H files for occurrences of RGB. That'll tell you for sure. Otherwise:
#define RED RGB(255,0,0)
#define WHITE RGB(0,0,0)
#define BLACK RGB(255,255,255)
#define GREEN RGB(0,255,0)
#define BLUE RGB(0,0,255)
#define PURPLE RGB(255,0,255)
#define LTBLUE RGB(0,255,255)
#define YELLOW RGB(255,255,0)
etc...
|
|
|
|
|
since there seems to be no default values, I will define them myself!
maybe not using #defines, but something similar
anyway!
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
This article colour picker cb[^] has a code listing of the common IE colours (about 128) with names and RGB values. You should be able to extract them and use those.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Does anyone know how to get the Display Name (e.g. "Microsoft Word Document") from a given extension (e.g. "doc").
I can't use ShGetFileInfo, because that requires a file you want information for. I won't have a file, just an extention.
Thanks!
|
|
|
|
|
Diarrhio wrote:
I can't use ShGetFileInfo
Sure you can - just use the SHGFI_USEFILEATTRIBUTES flag & the filename can be bogus.
- Shog9 -
I'd show a smile but I'm too weak
I'd share with you, could I only speak
|
|
|
|
|
|
Did you not read all of the documentation? It states:
If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function proceeds as if the file exists with the specified name and with the file attributes passed in the dwFileAttributes parameter. This enables you to obtain information about a file type by passing just the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes.
That implies that this will work:
SHFILEINFO fi;
CString strExtension;
m_ebExtension.GetWindowText(strExtension);
if (SHGetFileInfo(strExtension, FILE_ATTRIBUTE_NORMAL, &fi, sizeof(fi), SHGFI_USEFILEATTRIBUTES | SHGFI_TYPENAME) != 0)
{
m_staticAssocApp.SetWindowText(fi.szTypeName);
}
If you still do not want to use SHGetFileInfo(), try this. It's from the top of my head so you may have to tweak it:
HKEY hKey;
CString strExtension;
TCHAR szValue[128];
LONG lSize;
m_ebExtension.GetWindowText(strExtension);
if (RegOpenKey(HKEY_CLASSES_ROOT, strExtension, &hKey) == ERROR_SUCCESS)
{
lSize = sizeof(szValue);
RegQueryValue(hKey, _T(""), szValue, &lSize);
RegCloseKey(hKey);
if (RegOpenKey(HKEY_CLASSES_ROOT, szValue, &hKey) == ERROR_SUCCESS)
{
lSize = sizeof(szValue);
RegQueryValue(hKey, _T(""), szValue, &lSize);
RegCloseKey(hKey);
m_staticAssocApp.SetWindowText(szValue);
}
}
|
|
|
|
|
Friends,
We use ADO with VC++ in order to deal with database servers. My question is related to recordset object. When we execute certain query of select statement, the recoredset object contains the resultant records. Now please tell me where these records are actually present by default whether client side or server side ?? What happens when we fetch next record from recordset object? I want all records to be present on my client machine so that when i fetch records, there'll be no need to consult back server...how can i do so ???
|
|
|
|
|
It depends.
In ADO, you can set the cursor location to be server side or client side cursors. To force a recordset to be client side, do the following before you open the table/select statement etc. Note, this is VB code for swiftness.
rs.CursorLocation = adUseClient
For server side - adUseServer
Shameless Plug - Distributed Database Transactions in .NET using COM+
|
|
|
|
|
By default, the recordset objects are present on the server side. When you fetch a record from the recordset object, the data are got from the server via the network. You can let them be present on the client compute by changing the CursorLocation property of the recordset object.
In VC++:
_RecordsetPtr pRs;
pRs.CreateInstance(__uuidof(Recordset));
pRs->CursorLocation = ADOCG::adUseClient; //set the cursor to be client side
pRs->CursorLocation = ADOCG::adUseServer; //server side, the default
Hi guys. I'm a very fat man. Do you like fat men?
|
|
|
|
|
Could somebody give me a quick (and hopefully fairly jargon free) summary on how to attach a Microsoft .HLP file to a visual C++ program.
I have created the file using microsoft help workshop but i'm not sure how to attatch it.
How do i add it to the project so that F1 can be pressed and it can be accessed for the help menu??
Thanks
|
|
|
|
|
If its an MFC project that was created without help then you should be able to add:
// Global help commands
ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
to the mainframes message map.
Also check that you have an accelerator key mapped for F1 to ID_HELP
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Or you can just use:
BOOL WinHelp(
HWND hWndMain, // handle of window requesting Help
LPCTSTR lpszHelp, // address of directory-path string
UINT uCommand, // type of Help
DWORD dwData // additional data
);
This function did the trick for me a few months ago. Oh by the way, this is just the API function, but I think MFC has this function somewhere. Just search for it.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
I've been going over microsofts site and I still carn't find a list of exactly whats different between standard edition and professional. Could anyone here shed some light on the subject for me please.
Thanks for your help
Darren
|
|
|
|
|
My Windows service app is monitoring process activity on Windows 2000 system. PSAPI is giving me a list of running processes, but I can't obtain full module path for processes running under user account different than System or service's account - process HANDLEs are treated as invalid when they come from another account. I suppose that some security setting is preventing me from doing this, but how can I override it? I've also tried using kernel mode driver for this, but with the same results...
|
|
|
|
|
I have a dialog with a webbrowser control (via the CWebBrowser2 class). Now I want to display a html page in the control by passing a string that contains the actual html page. Is this possible? And if so, how do I do this?
|
|
|
|
|
i was never able to get it to accept a string. i have always had to write the page text out to a temp file, then tell the browser to read that file.
-c
|
|
|
|
|
It's possible, but it's a little ugly. Here's some code I think I found in the MSDN. I was just poking around with it for a while, not using it in a production environment, so it's not too clean.
USES_CONVERSION;
IDispatch * a_poDisp = c_oWebBrowser.GetDocument();
if( a_poDisp )
{
IHTMLDocument2 * a_poDoc = NULL;
a_poDisp->QueryInterface( IID_IHTMLDocument2, (void**)&a_poDoc );
if( a_poDoc )
{
HRESULT hresult = S_OK;
VARIANT *param;
SAFEARRAY *sfArray;
CString sHtml = ???
BSTR bstr = SysAllocString(A2COLE(sHtml));
sfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1);
hresult = SafeArrayAccessData(sfArray,(LPVOID*) & param);
param->vt = VT_BSTR;
param->bstrVal = bstr;
hresult = SafeArrayUnaccessData(sfArray);
hresult = a_poDoc->write(sfArray);
if( sfArray != NULL )
{
SafeArrayDestroy( sfArray );
}
a_poDoc->Release();
}
}
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
|
I found a very easy way to do this. Just insert "about:" in front of the string and pass it as the url in the Nagivate method.
|
|
|
|
|
Is it possible to disable the frame, so the user cant resize it anymore?
I have a FormView project, and I dont want the user to be able to resize the frame. I'm not sure how this could be done.
|
|
|
|
|
Try this... it's based on a dialog resizing, but it must work in the same way in your environment...
void CDialogResDlg::OnSizing(UINT fwSide, LPRECT pRect)
{
if (!this->bAllowResizing)
{
if (pRect->bottom - pRect->top != 400) pRect->bottom = pRect->top + 400;
if (pRect->right - pRect->left != 400) pRect->right = pRect->left + 400;
}
CDialog::OnSizing(fwSide, pRect);
} hope this helps...
|
|
|
|
|
You can just take of the WS_THICKFRAME window style. For example, in MFC override your main frame's PreCreateWindow function and do something like this:
cs.style &= ~WS_THICKFRAME;
You can take off other styles there, too, if you want (like if you don't want them to maximize or minimize the window). Look up "window styles" for more info.
|
|
|
|
|
In my CDialog-derived class, I want to call a method after the dialog has been shown, with no input from the user. If I call my method from OnInitDialog, the dialog is not shown until my method returns.
I tried using PostMessage in OnInitDialog to start the method, but the message was not caught. SendMessage worked, but the dialog was not shown before the method call.
Is there a simple way to do this?
dlb
|
|
|
|
|
PostMessage() is the way to go. The fact that it did not work indicates the message map was not quite right.
#define PM_CHANGE_FLAT (WM_APP + 0x123)<br />
<br />
static const UINT UDM_BLOW_NOSE = ::RegisterWindowMessage(_T("UDM_BLOW_NOSE"));<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)<br />
ON_MESSAGE(PM_CHANGE_FLAT, ChangeFlat)<br />
ON_REGISTERED_MESSAGE(UDM_BLOW_NOSE, BlowNose)<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CMyDlg::OnInitDialog() <br />
{<br />
<br />
PostMessage(UDM_BLOW_NOSE);<br />
PostMessage(PM_CHANGE_FLAT);<br />
<br />
return 0;<br />
}<br />
<br />
<br />
LRESULT CMyDlg::BlowNose( WPARAM, LPARAM )<br />
{<br />
return 0;<br />
}<br />
<br />
<br />
LRESULT CMyDlg::ChangeFlat( WPARAM, LPARAM )<br />
{<br />
return 0;<br />
}
|
|
|
|