Changeset 361
- Timestamp:
- Jun 19, 2009, 9:08:41 PM (16 years ago)
- Location:
- trunk/hlpmgr
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hlpmgr/utility.c
r360 r361 84 84 } 85 85 86 void StoreString( char** dest, 87 char* source ) 86 void StoreString( char** dest, char* source ) 88 87 { 89 88 if ( *dest != NULL ) -
trunk/hlpmgr/viewer.c
r26 r361 12 12 char* OWN_HELP_MARKER = "[NVHELP]"; 13 13 14 BOOL StartViewer( char* pszParameters,15 16 HWND hAppWindow,17 HAB hab )14 BOOL StartViewer( char* pszParameters, 15 HWND hTerminateNotify, 16 HWND hAppWindow, 17 HAB hab ) 18 18 { 19 19 PROGDETAILS Details; … … 42 42 43 43 44 LogEvent( "Launching: %s %s", 45 Details.pszExecutable, 46 pszParameters ); 47 48 hApplication = 44 LogEvent( "Launching: %s %s", Details.pszExecutable, pszParameters ); 45 46 hApplication = 49 47 WinStartApp( hTerminateNotify, // window to be notified of termination 50 48 & Details, // details … … 55 53 if ( hApplication == NULL ) 56 54 { 57 LogEvent( " Failed to launch viewer, rc=%8X", 58 WinGetLastError( hab ) ); 59 sprintf( pszMessageCaption, 60 "Unable to start help viewer %s", 61 pszViewerFilename ); 55 LogEvent( " Failed to launch viewer, rc=%8X", WinGetLastError( hab ) ); 56 sprintf( pszMessageCaption, "Unable to start help viewer %s", pszViewerFilename ); 62 57 WinMessageBox( HWND_DESKTOP, // parent 63 58 hAppWindow, // owner … … 69 64 } 70 65 else 71 { 66 { 72 67 result = TRUE; 73 68 } … … 77 72 } 78 73 74 79 75 // appends the given filenames to the output string, 80 76 // replace spaces between filenames with a + 81 77 // and stripping redundant spaces. 82 void ModifyFilenames( char* Filenames, 83 char* Output ) 78 void ModifyFilenames( char* Filenames, char* Output ) 84 79 { 85 80 BOOL First; … … 92 87 { 93 88 // skip spaces 94 while ( *Filenames != 0 89 while ( *Filenames != 0 95 90 && *Filenames == ' ' ) 96 91 Filenames ++; … … 105 100 106 101 First = FALSE; 107 // copy non-space characters 102 // copy non-space characters 108 103 // or all characters if in quotes 109 while ( *Filenames != 0 104 while ( *Filenames != 0 110 105 && ( *Filenames != ' ' || InQuote ) ) 111 106 { … … 113 108 if ( ! InQuote ) 114 109 { 115 if ( *Filenames == '\'' 110 if ( *Filenames == '\'' 116 111 || *Filenames == '\"' ) 117 112 { … … 121 116 } 122 117 } 123 else 118 else 124 119 { 125 120 if ( *Filenames == QuoteChar ) … … 128 123 * Output = '\"'; // change singles to doubles 129 124 } 130 } 131 125 } 126 132 127 Output ++; 133 128 Filenames ++; … … 138 133 *Output = 0; 139 134 } 135 140 136 141 137 BOOL ViewHelpFile( char* pszHelpFileName, … … 148 144 149 145 // set up viewer parameters: 150 // <helpfilename> /hm:<helpwindow> 146 // <helpfilename> /hm:<helpwindow> 151 147 // currently not used: /owner:<ownerwindow> 152 148 153 pszParameters = (char*) malloc( strlen( pszHelpFileName ) 149 pszParameters = (char*) malloc( strlen( pszHelpFileName ) 154 150 + strlen( pszWindowTitle ) 155 151 + 512 ); 156 152 157 sprintf( pszParameters, 158 "/hm:%u ", 159 hHelpWindow ); 153 sprintf( pszParameters, "/hm:%u ", hHelpWindow ); 160 154 161 155 if ( pszHelpFileName != NULL ) … … 166 160 } 167 161 168 if ( pszWindowTitle != NULL ) 162 if ( pszWindowTitle != NULL ) 169 163 { 170 164 // add window title parameter … … 174 168 } 175 169 176 return StartViewer( pszParameters,177 178 179 hab );170 return StartViewer( pszParameters, 171 hHelpWindow, 172 hAppWindow, 173 hab ); 180 174 } 175 181 176 182 177 void ViewHelpOnHelp( HAB hab ) 183 178 { 184 StartViewer( OWN_HELP_MARKER,185 186 NULL,187 hab );179 StartViewer( OWN_HELP_MARKER, 180 NULL, 181 NULL, 182 hab ); 188 183 } 189 184
Note:
See TracChangeset
for help on using the changeset viewer.