Sunday, May 10, 2009

IsIPAddressInRange like API in C/C++/php?

are you aware of any api in c,c++ or php which can varify whether a given IP address falls under a given range


How i can add animated gif to the window with gdi , c++ & Win32 API ?

HI - thanks for visiting.


do you know , how i can add animated gif to the window with gdi , c++ %26amp; Win32 API ( without MFC ).

How i can add animated gif to the window with gdi , c++ %26amp; Win32 API ?
Use Borland C++ Builder...you can do it in a few minutes.


How do I use a custom bitmap for a toolbar button? (C++, Win32 Api)?

I am using C++ and the Windows Api. How do I load and set the image for a toolbar button.

How do I use a custom bitmap for a toolbar button? (C++, Win32 Api)?
SUMMARY


This article demonstrates how to use Command bars and WIN32 application programming interfaces (APIs) to add a transparent icon to a custom menu or toolbar command.


MORE INFORMATION


The following Visual Basic sample demonstrates how to convert an icon to a bitmap using the current user's system color settings for the background of the icon, and then add the bitmap to a custom menu command or toolbar button: Public Declare Function DrawIconEx Lib "user32"


(ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal


hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long,


ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long,


ByVal diFlags As Long) As Long


Public Declare Function CreateIC Lib "gdi32" Alias "CreateICA"


(ByVal lpDriverName As String, ByVal lpDeviceName As String,


ByVal lpOutput As String, ByVal lpInitData As String) As Long


Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long


Public Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long


Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long





'The call to the below function adds an item to the Tools menu using a


'bitmap in a resource file with the resource ID of 102. This ID number


'should be changed to match the ID of your bitmap if you are using


'resource file.


'All items added to resource files have a resource identifier number.





'You can replace the resource file with a bitmap from any source.





AddIconToCommandBar "Tools", 102





Public Sub AddIconToCommandBar(BarName As String, IconId As Integer)


Dim cbMenu As CommandBar


Dim cbButton As CommandBarButton


Dim oBMP As StdPicture


Dim oICO As StdPicture


' Set to the commandbar you want to add to:


Set cbMenu = Application.CommandBars(BarName)


If Not cbMenu Is Nothing Then


Set cbButton = cbMenu.Controls.Add(msoControlButton)


If Not cbButton Is Nothing Then


' Get the existing face.


cbButton.CopyFace


Set oBMP = Clipboard.GetData


' Load the icon from the resource file.


Set oICO = LoadResPicture(IconId, vbResIcon)


' Copy the icon over the existing face to preserve the background color.





CopyIconToBmp oICO, oBMP


Clipboard.Clear


Clipboard.SetData oBMP, ccCFBitmap


Clipboard.SetData oBMP, ccCFDIB


' Draw the icon on the menu.


cbButton.PasteFace


'cbButton.BeginGroup = True


cbButton.Caption = MENUCAPTION





End If ' cbButton


End If ' cbMenu


End Sub





Private Sub CopyIconToBmp(oIcon As StdPicture, oBMP As StdPicture)


Dim Rc As Long


Dim hdc As Long


Dim hdcMem As Long


Dim hBmOld As Long


hdc = CreateIC("DISPLAY", vbNullChar, vbNullChar, vbNullChar)


hdcMem = CreateCompatibleDC(hdc)


hBmOld = SelectObject(hdcMem, oBMP.Handle)


Rc = DrawIconEx(hdcMem, 0, 0, oIcon.Handle, 16, 16, 0, 0, DI_NORMAL)


SelectObject hdcMem, hBmOld


DeleteDC hdc


DeleteDC hdcMem


End Sub














APPLIES TO


• Microsoft Outlook 97 Standard Edition


• Microsoft Outlook 98 Standard Edition


• Microsoft Outlook 2000 Standard Edition


• Microsoft Visual Basic 6.0 Professional Edition


• Microsoft Visual Basic 6.0 Enterprise Edition


http://www.codeguru.com/cpp/w-p/win32/


http://www.codeguru.com/Cpp/controls/but...


( NO MFC ) How I Know Mouse Is Over Button Control With C++ & Win32 API ?

please exaplain in code how i know mouse pointer is on my Button Control . Please Exaplian With C++ %26amp; Win32 API





( NO MFC ) --------Thanks .

( NO MFC ) How I Know Mouse Is Over Button Control With C++ %26amp; Win32 API ?
This Link will help you my friend





http://www.codeguru.com/cpp/controls/tre...

flower girl dresses

How i can load gif images with GDI C++ & win32 API ?

hi - thanks for your attention .


i want to know how i can use GIF images with GDI , C++ , Win32 API ( without MFC ) .

How i can load gif images with GDI C++ %26amp; win32 API ?
Hi,


You can look up the article :


http://www.codeproject.com/bitmap/pictur...


which uses the gdi and win32 api.





you maybe want to use gdi+:


http://www.codeproject.com/vcpp/gdiplus/...





with best regards.


How i can load gif images with GDI C++ & win32 API ?

hi - thanks for your attention .


i want to know how i can use GIF images with GDI , C++ , Win32 API ( without MFC ) .

How i can load gif images with GDI C++ %26amp; win32 API ?
Hi, Pls take a look at the following link





http://www.codeproject.com/vcpp/gdiplus/...





explains how you can use gif in GDI
Reply:http://members.aol.com/royalef/gifmake.h...


http://www.bobpowell.net/giftransparency...


http://www.devx.com/projectcool/Article/...


http://www.frontiernet.net/~steve_glimps...


http://www.htmltutorials.ca/lesson15.htm


http://www.infocellar.com/Graphics/16-co...


http://www.webwitchery.com/articles/form...


http://www.emu.edu.tr/english/facilities...


http://en.wikipedia.org/wiki/GIF


http://kancrn.kckps.k12.ks.us/ats/mybett...


http://www.webreference.com/dev/gifanim/


Please visit the above pages. I hope, it helps u.


How I can draw custom scrollbar with c++ & win32 API ( No MFC ) ?

please explain that how ican draw custom scroll bar with c++ %26amp; win32 API - without MFC





Thanks.

How I can draw custom scrollbar with c++ %26amp; win32 API ( No MFC ) ?
I think if you check the source code for "Cool Scrollbars", you might find the info (or some of it) you need.





It is written in C, but the author talks about what it takes to do it in C++.





http://www.thecodeproject.com/dialog/coo...


http://www.catch22.net/tuts/coolscroll.a...





I haven't looked at it to any detail, but I hope you find it useful.
Reply:Look at the code snippets at danniweb.


Help calling Borland C++ based API from MSV C++?

I am trying to call a Borland C++ based API from a Microsoft Visual C++ application via a dll from the Borland Code. I am not having much luck. Are there any common errors or mistakes that could cause this? I know it is possible, but for some reason I am struggling to make it work. Thank you in advance for help.

Help calling Borland C++ based API from MSV C++?
Given your absolute lack of details, it’s impossible to diagnose your problem. However, I will point out some obstacles in what you want to do. The first is that you are trying to use a dll for use with borland linker with VC++. I don’t know if the BC++ linker emulates VC++, but if it doesn’t, you will have trouble directly using it. Any fixes are going to be ugly, which probably involving figuring out the mangled names to use for the import definitions.





The second obstacle is dll dependencies. You are working with the VC++ runtime, so if the borland dll requires additional borland components like their runtime, you now have a problem.

flower garden

How Catch Events For Bitmap Using Win32 API & C++ (No MFC)?

please Show how i can catch events for a bitmap image without MFC.


ONLY win32 api


ONLY c++





Thanks

How Catch Events For Bitmap Using Win32 API %26amp; C++ (No MFC)?
What do you mean catch events with Bitmaps? First of all whenever you need to catch events, you would need the pointer of the location you wish to cause that event.





So you would need the pointer to that bitmap (I don't know if any event would help here)





But if you wish to find the pointer of the Bitmap you could use this function.


// Loads A Bitmap Image


AUX_RGBImageRec *LoadBMP(char *Filename) {


// File Handle


FILE *File=NULL;


// Make Sure A Filename Was Given


if (!Filename)


{


// If Not Return NULL


return NULL;


}


// Check To See If The File Exists


File=fopen(Filename,"r");


if (File) // Does The File Exist?


{


// Close The Handle


fclose(File);


// Load The Bitmap And Return A Pointer


return auxDIBImageLoad(Filename);


}


// If Load Failed Return NULL


return NULL;


}





The above function will return a pointer to that image using the normal C++ library... What you would do later is if the image is loaded or whatever you choose from you just pass that pointer to your application. You would need to create callbacks to handle the function pointers that will accept that pointer.


How create custom button with Win32 API & C++ ( Not MFC ) ?

please show how i can create custom button with win32 api and c++ . only win32 api , no mfc .


i saw sites . please explain .


Thanks.

How create custom button with Win32 API %26amp; C++ ( Not MFC ) ?
Create a button with style BS_OWNERDRAW. The BUTTON class then sends a WM_DRAWITEM to the parent window whenever it recieves a WM_PAINT message.





Simple Example:


case WM_DRAWITEM:


{


DRAWITEMSTRUCT* data=(DRAWITEMSTRUCT*)lParam;


if(data-%26gt;itemState %26amp; ODS_SELECTED)


DrawEdge(data-%26gt;hDC, %26amp;data-%26gt;rcItem, EDGE_SUNKEN, 0);


else


DrawEdge(data-%26gt;hDC, %26amp;data-%26gt;rcItem, EDGE_RAISED, 0);


return TRUE; //We handled this message


}


This draws a pressable blank button.








typedef struct tagDRAWITEMSTRUCT {


UINT CtlType;


UINT CtlID;


UINT itemID;


UINT itemAction;


UINT itemState;


HWND hwndItem;


HDC hDC;


RECT rcItem;


DWORD itemData;


} DRAWITEMSTRUCT;





Please see http://msdn.microsoft.com/library/defaul... for more information


Anyone know where to find a good Excel generation C# api?

Does anyone know where I can find a good open source C# api for generating Excel reports?

Anyone know where to find a good Excel generation C# api?
Excel registers a collection of object libraries that can be accessed directly. Those COM objects provide a full API that's accessible by an app that uses COM. MS knowledge base can tell you a bunch, e.g.,





http://support.microsoft.com/kb/302084
Reply:Try these:


Anyone know where to find a good Excel generation C# api?

Does anyone know where I can find a good open source C# api for generating Excel reports?

Anyone know where to find a good Excel generation C# api?
I might be wrong, but I don't think you need 3rd party API to do that.


You just need to have Excel interop DLL and use it to create your own excel report.





Some examples:


http://support.microsoft.com/kb/302084


http://www.spreadsheetgear.com/support/s...


http://www.eggheadcafe.com/articles/2002...

edible flowers

Is there a C++ API documentation generator that will run on Ubuntu Linux 7?

I'm looking for a C++ API documentation generator for the Linux operating system. I've tried Google, package manager, and found nothing. An example of what I'm looking for can be found here (but the rest of the website is down)





http://www.cs.rit.edu/~cs4/pub/OnlineDoc...

Is there a C++ API documentation generator that will run on Ubuntu Linux 7?
There's always Doxygen:





http://www.doxygen.org/
Reply:Try the Eclipse IDE. I know it generates documentation for Java API, I am pretty sure it can do the same for C++. Eclipse should be in the default apt repos of your system.


Are there any API tutorials for c++ beginer -> advanced ?

Please give me links to C++ api tutorials from beginer -%26gt; advanced . I already know C++ but just a few things about API.

Are there any API tutorials for c++ beginer -%26gt; advanced ?
Assuming you mean Windows API, this is the website that helped me to learn it: http://www.relisoft.com/win32/index.htm
Reply:Seems reasonable.


C# API documentation?

I'm new to C# and im having trouble finding its API. I was hoping that i can find an API that is somewhat similar to Java's.





Thanks

C# API documentation?
MSDN is the equivelant to these resources. You can either install it locally from the Library DVD's or visit http://msdn2.microsoft.com/en-us/library...
Reply:Try www.msdn.microsoft.com
Reply:I could not find it either. Sun is very good about pushing updates. Borland has always been behind the curve. I don't think they written one yet.