1

Topic: MFC - how to correct resources

Is  programs  on a C ++/MFC (source codes are not present) Inside there is a dialog box in which there is a combo-boh - whether it is possible to correct in it a combo-boxing pair of values in the drop down list, without having source codes? Where generally the data of the drop down list of a combo-boxing is stored? In resources?

2

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> Is  programs  on a C ++/MFC (source codes are not present) N> Inside there is a dialog box in which there is a combo-boh - whether it is possible to correct in it a combo-boxing pair of values in the drop down list, without having source codes? N> where generally the data of the drop down list of a combo-boxing is stored? In resources? Depends on the program, probably values are registered in the code or calculated dynamic. Program resources can be looked and edited in a Visual Studio opening by means of it exe a file.

3

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> Where generally the data of the drop down list of a combo-boxing is stored? In resources? There, whence they took the code adding these values. Something similar to a data binding to  besides explicitly written code AFAIK in MFC is not present But, maybe, and in resources, for example century STRINGTABLE

4

Re: MFC - how to correct resources

Hello, Pavel Dvorkin, you wrote: PD> Hello, nobody1985, you wrote: N>> Where generally the data of the drop down list of a combo-boxing is stored? In resources? PD> there, whence they took the code adding these values. Something similar to a data binding to  besides explicitly written code AFAIK in MFC is not present PD> But, maybe, and in resources, for example century STRINGTABLE I.e. except how to cause CComboBox:: AddString other methods to fill the drop down list is not present? I with MFC did not work for a long time, but like there it was possible static lines directly in the visual designer of a Visual Studio in a combo-boxing to hammer. Though can and I am mistaken.

5

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> I.e. except how to cause CComboBox:: AddString other methods to fill the drop down list is not present? N> I with MFC did not work for a long time, but like there it was possible static lines directly in the visual designer of a Visual Studio in a combo-boxing to hammer. Though can and I am mistaken. It is possible. But very few people uses it. We begin that application can store in itself an array of any objects, and in a combo only its reflection then outside elements lead to unpredictable operation. And if application is valid can  the left elements easier to add them through CB_ADDSTRING or other messages. That is, I at first would check up, whether it can accept generally a new line. It is possible to try to send at first SendMessage though from other process (CB_ADDSTRING <WM_USER), beforehand peeping HWND in a C ++ to be convinced that collapses nothing. SendMessageW ((HWND) 0x2047A, CB_ADDSTRING, 0, (LPARAM) L "Test"); //0x2047A -  the combo If does not collapse, as the permanent decision I can offer  which would create , and hung up SetWindowsHookEx on it UI , in   appearance of the necessary combo and to substitute a content.

6

Re: MFC - how to correct resources

Hello, Alexander G, you wrote: AG> It is possible to try to send at first SendMessage though from other process (CB_ADDSTRING <WM_USER), beforehand peeping HWND in a C ++ to be convinced that collapses nothing. AG> SendMessageW ((HWND) 0x2047A, CB_ADDSTRING, 0, (LPARAM) L "Test");//0x2047A -  the combo From other process does not turn out. The pointer for the line system  will not be. The target window instead of a line receives garbage.

7

Re: MFC - how to correct resources

Hello, V. Zudin, you wrote: SVZ> From other process it does not turn out. The pointer for the line system  will not be. The target window instead of a line receives garbage. Will be. I specially specified CB_ADDSTRING less WM_USER. A rule idle time: everything that is less WM_USER - , though most known of such messages WM_COPYDATA and WM_SETTEXT

8

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> Where generally the data of the drop down list of a combo-boxing is stored? In resources? In resources MFC can add section DLGINIT from which initializes , but colleagues are right, more often lists are filled in . And in  lines can it is necessary undertake whence - from resources, from exterior files, from section dataful and so forth

9

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> Inside there is a dialog box in which there is a combo-boh - whether it is possible to correct in it a combo-boxing pair of values in the drop down list, without having source codes? Who knows as this combo box uses visible sheet? For example, if it Time Zone, and you correct the text - all will be APPRX. "(UTC+03:00) Moscow, St. Petersburg" replace on "(UTC+03:00) Moscow, Leningrad" But if you replace "+03:00" on "+07:00" - good luck!

10

Re: MFC - how to correct resources

Hello, V. Zudin, you wrote: AG>> SendMessageW ((HWND) 0x2047A, CB_ADDSTRING, 0, (LPARAM) L "Test");//0x2047A -  combo SVZ> From other process does not turn out. The pointer for the line system  will not be. The target window instead of a line receives garbage. +1 so it is simple - it does not turn out. But it is possible to write/read storage of that process.

11

Re: MFC - how to correct resources

Hello, VladFein, you wrote: AG>>> SendMessageW ((HWND) 0x2047A, CB_ADDSTRING, 0, (LPARAM) L "Test");//0x2047A -  combo VF> So is simple - it does not turn out. But it is possible to write/read storage of that process. For CB_ messages just at attempt it is independent  it does not turn out, since the system tries repeatedly .

12

Re: MFC - how to correct resources

Hello, Alexander G, you wrote: SVZ>> From other process it does not turn out. The pointer for the line system  will not be. The target window instead of a line receives garbage. AG> will be. I specially specified CB_ADDSTRING less WM_USER. AG> the Rule idle time: everything that is less WM_USER -  though most known of such messages WM_COPYDATA and WM_SETTEXT If all was so simply... WM_SIZING, WM_MOVING too it is less WM_USER, however pointers with these messages are transferred as is. As to WM_COPYDATA, it generally separate history. At first, it is specially intended for date transmission between processes, and secondly, "... The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data...".

13

Re: MFC - how to correct resources

Hello, Alexander G, you wrote: VF>> So it is simple - it does not turn out. But it is possible to write/read storage of that process. AG> for CB_ messages just at attempt it is independent  it does not turn out, since the system tries repeatedly . Thanks, you are right.

14

Re: MFC - how to correct resources

Hello, V. Zudin, you wrote: SVZ> If all was so simply... SVZ> WM_SIZING, WM_MOVING too it is less WM_USER, however pointers with these messages are transferred as is. Yes, seemingly, that  did not make for everything that it is less WM_USER, I was mistaken. But for CB_ADDSTRING - made. Means, a rule such: some messages which it is less WM_USER,  system.

15

Re: MFC - how to correct resources

Hello, VladFein, you wrote: VF> Who knows as this combo box uses visible sheet? VF> for example if it Time Zone, and you correct the text - all will be APPRX. VF> "(UTC+03:00) Moscow, St. Petersburg" VF> replace on VF> "(UTC+03:00) Moscow, Leningrad" VF> But if you replace "+03:00" on "+07:00" - good luck! Just in it and the purpose - to correct the text in combo box (there numerical constants) a little to change logic of the program - the selected numerical constant then is used as a factor for certain calculations... It is necessary, roughly speaking, all constants in a combo-boxing on 2 to increase (that then the result of calculations accordingly was in 2 times more)

16

Re: MFC - how to correct resources

Hello, nobody1985, you wrote: N> Just in it and the purpose - to correct the text in combo box (there numerical constants) a little to change logic of the program - the selected numerical constant then is used as a factor for certain calculations... It is necessary, roughly speaking, all constants in a combo-boxing on 2 to increase (that then the result of calculations accordingly was in 2 times more) If combo box is drop down + edit, i.e. it is possible to enter the, most likely, all turns out. If combo box is drop down list such variants are most probable: 1. The program  converts the text in number then all turns out. 2. The program uses an index of an element for reversal to an array of constants then the text on what does not affect 3. The program stores constants in item data then the text on what does not influence, but through messages  it is possible to change not only the text, but also item data