Apply the template programmatically?

 

Need the most efficient way possible in source code, using winapi exclusively.

A library is not an option.

Emulation of user actions too.

Help plz, I've got some cool stuff on my mind...

 
          33511 - графики -> шаблоны -> загрузить шаблон;
          34800  \ 
                  > порядковый номер шаблона из выпадающего списка (отсчет с нуля, т е 1 это второй в списке);
          34863  /
          33220 - графики -> шаблон -> сохранить шаблон;
 
I hope that's enough :)
 

Well... at least it's not too difficult from here.

Thanks :)

 
TheXpert:

Well... at least it's not too difficult from here.

So finding out the name of a non-existent menu item is easier for you than sending WM_COMMAND?
 
What do you mean by non-existent ?
 
sergeev:
So finding out the name of a non-existent menu item is easier for you than sending WM_COMMAND?

It's alphabetical. Most likely via search, so not much of a problem.

Here's the big problem -- saving the template. Can someone help?

 
if there is only one template, there is no problem. When 33220 is called, the template is set to the first one in order of name, then the button needs to be pressed. If there are many, you have to run down the list to select the one you want.
 
FAQ:

No, Rustam, you don't understand, I can't emulate user actions myself. I.e. either strict automation with no possibility of intervention, or minimal interactivity, followed again by hard and reliable identification of actions.

The bootstrapping problem is easily solved. All you have to do is build a list and match it.

With saving I've solved it a little crusty, but I don't see any other way.

So far:

-- I remember the current time, sleep for a second (optional).

-- Send 33220 via SendMessage. i.e. synchronously

-- Wait for save dialog to execute (interactive, saves to default folder for templates is mandatory), then build a list and look for last modified template, modification time is longer than memorized.


If anyone has a more efficient and better way, please let me know.

 
No, I solved it exactly the same way. perhaps it's better to just write directly to the file ?
 
FAQ:
No, I solved it exactly the same way. perhaps it's better to just write directly to the file ?
Write what? I don't understand you now.
Reason: