Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Exporting DLL icon resources as .ICO files
Storing registration key in the resources of an executable file
    Add comment     W32 Constants      Translate this page
The LoadResource function loads the specified resource into global memory.
Code examples:
Storing registration key in the resources of an executable file
Exporting DLL icon resources as .ICO files
HGLOBAL LoadResource(
    HMODULE hModule,
    HRSRC hResInfo
FoxPro declaration:
DECLARE INTEGER LoadResource IN kernel32;
    INTEGER hModule,;
    INTEGER hResInfo

[in] Handle to the module whose executable file contains the resource.

[in] Handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function.
Return value:
If the function succeeds, the return value is a handle to the data associated with the resource.
My comment:
If hModule is NULL, the system loads resource from the module that was used to create current process.

* * *
I am thinking about approaches to design of VFP application with auto-updateable executable, the master copy of which is stored on a web server. Definitely I am not the first person doing this -- read Rick Strahl`s article Automatic Application Updates over the Web with Visual FoxPro 7.0 -- so my thoughts may not be precisely original.

Normally Windows executable can not update itself. That means it needs help from another process; let`s call this one the Updating Process.

Six tasks for UP to get done:
- connect to the web server and check for updates
- check and terminate all processes originated from the main executable, ME
- download new version of ME from the web server
- overwrite ME
- restart ME
- terminate itself

For reasons of mobility UP executable can be stored as a binary resource inside ME. It is doable. ME can use something like LoadResource plus CopyMemory plus STRTOFILE() plus CreateProcess to invoke UP.
Word Index links for the LoadResource :
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
Created: 2003-05-16 10:21:55
Modified: 2006-01-17 20:17:00
Visited in last 7 days: 42
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
19 sec.Function: 'SHGetFolderLocation'
38 sec.Function: 'UnloadUserProfile'
59 sec.Function: 'OpenWaitableTimer'
1.3 min.Function: 'GetUserGeoID'
1.65 min.Function: 'LockResource'
1.9 min.Function: 'TaskDialog'
2.17 min.
Function group: 'Window Class'
2.47 min.Function: 'AVIFileRelease'
2.77 min.Function: 'IsWindowVisible'
3.02 min.Function: 'EnumProcessModules'
Advertise here!