|
It all depends on what your "definition" of hard is. Some folks find it harder than other programming languages and vice versa.
|
|
|
|
|
Hello!
C++ is easy :P
php is very similar to plain C. C++ is far more complicated in its nature, but you do not have to learn whole language to be able to write something. But for sure, php is simpler subject than c++.
|
|
|
|
|
Hello,
I am looking for a way to detect the system's color palette( On XP color quality). This is setup on the Display Properties at the settings tab. I need to know if the computer is running using "16 Color", "255 Color", "16 Bit" and so on. Any ideas?
|
|
|
|
|
|
Thanks, just what I was looking for.
|
|
|
|
|
Does Windows remember the last accessed folder per application anywhere? I'm not talking about information intentionally saved by an app in the registry or an INI file, but rather Windows doing this on its own. For example:- Run App1, do a File|Open to
C:\foo . Exit App1.
- Run App2, do a File|Open to
C:\bar . Exit App2.
- Run App1 again and a File|Open - the Open File dialog defaults to
C:\foo . /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It seems like the common file dialog 'remembers' the last folder visited on a per-application basis. I believe the information is stored in the registry, but I can't remember the key where it does so.
Software Zen: delete this;
|
|
|
|
|
How would one go about sending keystrokes to a specific (not necessarily active) window? I have been working on this for awile, so any help would be appreciated.
-Dev578
|
|
|
|
|
If you have access to the window (either a CWnd pointer or an HWND ), you could use SendMessage() to send it messages simulating keystrokes (eg: WM_KWYDOWN , WM_KEYUP , WM_LBUTTONDOWN , WM_LBUTTONUP , WM_LBUTTONDBLCLK ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Here's how I did it.
I had a window "PCTV Vision" that I had to send ALT-R.
I used a tool simillar to Spy++, it comes with Borland Delphi 3 and it is called Winsight32.
With WInsight I selected that window and I started logging all the messages that went to that window. Then I made it active and pressed ALT-R from the keyboard.
I returned to WInsight32 and looked in the message log. I found there a WM_COMMAND which he recognized as "Accelerator".
I shamelessly copied the WParam and Lparam and pasted it in my program which sounds like
PostMessage(hwnd,WM_COMMAND,stolen_WPARAM,stolen_LPARAM);
The good part is that it works!!!
I never tried Spy++ because I haven't installed Visual Studio Completely and it isn't installed.
|
|
|
|
|
Hello,
I am trying to draw tab text a different color if the tab receives a TCM_HIGHLIGHTITEM message.. I have created my CTabCtrlEx class and did a override for DrawItem.. My tab control is coloring selected item text blue and none selected items default (black) now I want to catch the TCM_HIGHLIGHTITEM message and color that text red... Here's what I have so far (the problem is that the red doesn't work)
void CTabCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
TC_ITEM tci;
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpDIS->itemID == (UINT)GetCurSel());
CRect rItem(lpDIS->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
pDC->FillSolidRect(rItem, ::GetSysColor(COLOR_3DFACE));
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
tci.mask = TCIF_TEXT | TCIF_IMAGE;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
GetItem(lpDIS->itemID, &tci);
sTemp.ReleaseBuffer();
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
if((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
pDC->SetTextColor(RGB(0,0,255));
else if(lpDIS->itemState & TCIS_HIGHLIGHTED)
pDC->SetTextColor(RGB(255,0,0));
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
Any ideas?
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Just incase anyone has the same problem here's the fix / working code..
void CTabCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
CDC* pDC = CDC::FromHandle(lpDIS->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpDIS->itemID == (UINT)GetCurSel());
CRect rItem(lpDIS->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
pDC->FillSolidRect(rItem, ::GetSysColor(COLOR_3DFACE));
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
TC_ITEM tci;
tci.mask = (TCIF_TEXT | TCIF_IMAGE | TCIF_STATE | TCIF_PARAM);
tci.dwStateMask = TCIS_HIGHLIGHTED;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
tci.dwState = TCIS_HIGHLIGHTED;
GetItem(lpDIS->itemID, &tci);
sTemp.ReleaseBuffer();
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
if((lpDIS->itemState & ODS_SELECTED) && (lpDIS->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)))
pDC->SetTextColor(RGB(0,0,255));
else if((tci.dwState & TCIS_HIGHLIGHTED) && (lpDIS->itemAction & ODA_DRAWENTIRE))
{
pDC->SetTextColor(RGB(255,0,0));
}
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Dear All,
Anybody have a example program of captioned title ? how can I do it ? I would make the text and graphic rotate about Y axis ?
Regards,.
Anson
|
|
|
|
|
Rotating text is not that hard. See the lfEscapement parameter of the LOGFONT structure. As for graphics, you will either need to write your own or get ahold of a graphics/DIB/BMP library.
onwards and upwards...
|
|
|
|
|
Hi!
i've build an vs.net 2003 addin using the addin wizard. is it possible to run the addin on visual studio.net 2002 too?
thanks
|
|
|
|
|
hello,
urgent need on INA Grid Control...
requires samples how it works
it is a 3rd party control ...
requires articles & URLS for that.
thanks
skpanda
|
|
|
|
|
hello ,
how to enumerate name of domains & the name of computers connected to each domain in a network . using win32 api..
any type of application is welcome whether it will be in MFC, COM or ATL or WIN 32
MFC / WIN32 most wanted...
please give tips & snipet of code if available ...give also URLs & site address...
skpanda
|
|
|
|
|
One solution is NetServerEnum(). Check out MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netserverenum.asp
Kuphryn
|
|
|
|
|
hello again,
i refered your suggession and created one MFC application ....in which i m creating a button , a combo box a list box and some other control for my project.
1. what i did (achieved) is :
when i clicked the button the application is flooding the no of domains ,servers and the individual computers at a time in a sequence by a callback function NetServerEnum() (callback --->i think so till now not checked) & i m displaying in the list box. but my requirement is different in the following manner ....
2. my requirement is :
when i click the button the application should enumerate the no of domains first and should put in the combo box.then when i will select one of the domain from the combo , i should get the list of computers in that particular domain , which i want to show in the list box.
how to do that ... using the same function ...??
please guide me ...
thanking u.
panda
|
|
|
|
|
Hi,
I need to access the XML data stored in a IWebBrowser2 (a CHtmlView in fact) to update some nodes without reloading the page, but I can't find how to do this.
I can update the final HTML result, but not the original XML data (I use XSLT to display the data)
Do someone have an idea ?
Thx
MistER-j
|
|
|
|
|
Off the top of my head and I say this isn't possible. I'm using the Webbrowser control in a new app (see www.surfulater.com[^]) and have written a lot of code to interact with it, but I haven't tried embedding standard Windows controls. You can probably only do this with an ActiveX control.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hi,
I am trying to print to a network printer from a isapi exstension service on a web server. Basically I want to have the web server print a label automatically in response to certain http posts from a client. Ive got everything going except for the most important part. The printing. I cant seem to find any info on printing without using some sort of form. I would like to just print two, centered lines to a label printer. Any Ideas on this? Much Thanks in advance.
|
|
|
|
|
Your ISAPI dll is just another dll except that it is called by a web server instead of an application. You can call the traditional device context functions to print, such as CreateDC("WINSPOOL", "HP LaserJet 5P", NULL, NULL) and StartDoc, StartPage, gdi drawing functions, EndPage, EndDoc, DeleteDC, or you can opt to write directly to the print spooler with functions such as OpenPrinter, StartDocPrinter, StartPagePrinter, WritePrinter, EndPagePrinter, EndDocPrinter, and ClosePrinter.
The only real restrictions are that you should not create any windows, nor should you assume that you can access network resources, since your dll may be running under the localsystem account.
If you choose the DC method, you can use the WINAPI functions with HDC handles, or choose to use the MFC CDC class.
onwards and upwards...
|
|
|
|
|
I have created a ActiveX control using ATL.
The ATL control houses an MFC based control (that is use in other app). The ActiveX library also makes uses of some code that uses sockets and is multithreaded. The DLL itself is a CWinApp based class.
The problem is that when the DLL registers itself, all the initialization calls work fine, but when the closing ExitInstance call is made, it hangs while I try and clean up a thread, first telling the thread to stop, and then calling
WaitForSingleObject( threadHandle, INFINITE );
to wait till it's gone. This works fine when the code is used in an EXE, but used as part of the ActiveX DLL it just hangs.
Is there some trick I am missing to making an ATL based ActiveX control work with multiple worker threads?
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
How are you telling the tread to stop? If you control is Apartment threaded and you make an incoming call to the thread that created an (COM) object after you have told the thread to stop, you must pump messages as you wait for a worker thread to stop.
Try replacing the WaitForSingleObject with MsgWaitForMultipleObjects - including a message pump. Do a search for MsgWaitForMultipleObjects on MSDN, there is an example in there somewhere.
If that doesn't work try posting the code for the worker thread (the main 'loop' of it) along with what you do to make it stop.
|
|
|
|
|